home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1989-10-01 | 52.3 KB | [ TEXT/MPS ]
open in: MacOS 8.1
extracted
|
Win98
extracted
|
DOS
extracted
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary ).
Confidence Program Detection Match Type Support
66%
dexvert
ZX81 Sinclair BASIC (image/sinclairBASIC)
ext
Supported
10%
dexvert
MacBinary (archive/macBinary)
fallback
Supported
1%
dexvert
Text File (text/txt)
fallback
Supported
100%
file
MacBinary II, inited, Sun Oct 1 00:00:00 1989, modified Sun Oct 1 00:00:00 1989, creator 'MPS ', type ASCII, 52960 bytes "TEStyleSample.p" , at 0xcf60 315 bytes resource
default (weak)
99%
file
data
default
74%
TrID
Macintosh plain text (MacBinary)
default
25%
TrID
MacBinary 2
default (weak)
100%
siegfried
fmt/1762 MacBinary (II)
default
100%
lsar
MacBinary
default
id metadata key value macFileType [ TEXT] macFileCreator [ MPS ]
hex view +--------+-------------------------+-------------------------+--------+--------+ |00000000| 00 0f 54 45 53 74 79 6c | 65 53 61 6d 70 6c 65 2e |..TEStyl|eSample.| |00000010| 70 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |p.......|........| |00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......| |00000050| 00 00 00 00 00 ce e0 00 | 00 01 3b a1 4b 3c 40 a1 |........|..;.K<@.| |00000060| 4b 3c 40 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |K<@.....|........| |00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 50 73 00 00 |........|....Ps..| |00000080| 7b 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |{-------|--------| |00000090| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------| |000000a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------| |000000b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------| |000000c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0d |--------|-------.| |000000d0| 23 0d 23 09 41 70 70 6c | 65 20 4d 61 63 69 6e 74 |#.#.Appl|e Macint| |000000e0| 6f 73 68 20 44 65 76 65 | 6c 6f 70 65 72 20 54 65 |osh Deve|loper Te| |000000f0| 63 68 6e 69 63 61 6c 20 | 53 75 70 70 6f 72 74 0d |chnical |Support.| |00000100| 23 0d 23 09 4d 75 6c 74 | 69 46 69 6e 64 65 72 2d |#.#.Mult|iFinder-| |00000110| 41 77 61 72 65 20 53 69 | 6d 70 6c 65 20 53 74 79 |Aware Si|mple Sty| |00000120| 6c 65 64 20 54 65 78 74 | 45 64 69 74 20 53 61 6d |led Text|Edit Sam| |00000130| 70 6c 65 20 41 70 70 6c | 69 63 61 74 69 6f 6e 0d |ple Appl|ication.| |00000140| 23 0d 23 09 54 45 53 74 | 79 6c 65 53 61 6d 70 6c |#.#.TESt|yleSampl| |00000150| 65 0d 23 0d 23 09 54 45 | 53 74 79 6c 65 53 61 6d |e.#.#.TE|StyleSam| |00000160| 70 6c 65 2e 70 09 2d 09 | 50 61 73 63 61 6c 20 53 |ple.p.-.|Pascal S| |00000170| 6f 75 72 63 65 0d 23 0d | 23 09 43 6f 70 79 72 69 |ource.#.|#.Copyri| |00000180| 67 68 74 20 a9 20 31 39 | 38 39 20 41 70 70 6c 65 |ght . 19|89 Apple| |00000190| 20 43 6f 6d 70 75 74 65 | 72 2c 20 49 6e 63 2e 0d | Compute|r, Inc..| |000001a0| 23 09 41 6c 6c 20 72 69 | 67 68 74 73 20 72 65 73 |#.All ri|ghts res| |000001b0| 65 72 76 65 64 2e 0d 23 | 0d 23 09 56 65 72 73 69 |erved..#|.#.Versi| |000001c0| 6f 6e 73 3a 09 31 2e 30 | 09 09 09 09 09 09 31 30 |ons:.1.0|......10| |000001d0| 2f 38 39 0d 23 0d 23 09 | 43 6f 6d 70 6f 6e 65 6e |/89.#.#.|Componen| |000001e0| 74 73 3a 09 54 45 53 74 | 79 6c 65 53 61 6d 70 6c |ts:.TESt|yleSampl| |000001f0| 65 2e 70 09 09 09 4f 63 | 74 6f 62 65 72 09 31 2c |e.p...Oc|tober.1,| |00000200| 20 31 39 38 39 0d 23 09 | 09 09 09 54 45 53 74 79 | 1989.#.|...TESty| |00000210| 6c 65 53 61 6d 70 6c 65 | 47 6c 75 65 2e 61 09 09 |leSample|Glue.a..| |00000220| 4f 63 74 6f 62 65 72 09 | 31 2c 20 31 39 38 39 0d |October.|1, 1989.| |00000230| 23 09 09 09 09 54 45 53 | 74 79 6c 65 53 61 6d 70 |#....TES|tyleSamp| |00000240| 6c 65 2e 72 09 09 09 4f | 63 74 6f 62 65 72 09 31 |le.r...O|ctober.1| |00000250| 2c 20 31 39 38 39 0d 23 | 09 09 09 09 54 45 53 74 |, 1989.#|....TESt| |00000260| 79 6c 65 53 61 6d 70 6c | 65 2e 68 09 09 09 4f 63 |yleSampl|e.h...Oc| |00000270| 74 6f 62 65 72 09 31 2c | 20 31 39 38 39 0d 23 09 |tober.1,| 1989.#.| |00000280| 09 09 09 50 54 45 53 74 | 79 6c 65 53 61 6d 70 6c |...PTESt|yleSampl| |00000290| 65 2e 6d 61 6b 65 09 09 | 4f 63 74 6f 62 65 72 09 |e.make..|October.| |000002a0| 31 2c 20 31 39 38 39 0d | 23 0d 23 09 54 45 53 74 |1, 1989.|#.#.TESt| |000002b0| 79 6c 65 53 61 6d 70 6c | 65 20 69 73 20 61 6e 20 |yleSampl|e is an | |000002c0| 65 78 61 6d 70 6c 65 20 | 61 70 70 6c 69 63 61 74 |example |applicat| |000002d0| 69 6f 6e 20 74 68 61 74 | 20 64 65 6d 6f 6e 73 74 |ion that| demonst| |000002e0| 72 61 74 65 73 20 68 6f | 77 20 0d 23 09 74 6f 20 |rates ho|w .#.to | |000002f0| 69 6e 69 74 69 61 6c 69 | 7a 65 20 74 68 65 20 63 |initiali|ze the c| |00000300| 6f 6d 6d 6f 6e 6c 79 20 | 75 73 65 64 20 74 6f 6f |ommonly |used too| |00000310| 6c 62 6f 78 20 6d 61 6e | 61 67 65 72 73 2c 20 6f |lbox man|agers, o| |00000320| 70 65 72 61 74 65 20 0d | 23 09 73 75 63 63 65 73 |perate .|#.succes| |00000330| 73 66 75 6c 6c 79 20 75 | 6e 64 65 72 20 4d 75 6c |sfully u|nder Mul| |00000340| 74 69 46 69 6e 64 65 72 | 2c 20 68 61 6e 64 6c 65 |tiFinder|, handle| |00000350| 20 64 65 73 6b 20 61 63 | 63 65 73 73 6f 72 69 65 | desk ac|cessorie| |00000360| 73 20 61 6e 64 20 0d 23 | 09 63 72 65 61 74 65 2c |s and .#|.create,| |00000370| 20 67 72 6f 77 2c 20 61 | 6e 64 20 7a 6f 6f 6d 20 | grow, a|nd zoom | |00000380| 77 69 6e 64 6f 77 73 2e | 20 42 6f 74 68 20 73 74 |windows.| Both st| |00000390| 79 6c 65 64 20 61 6e 64 | 20 66 75 6e 64 61 6d 65 |yled and| fundame| |000003a0| 6e 74 61 6c 20 54 65 78 | 74 45 64 69 74 20 0d 23 |ntal Tex|tEdit .#| |000003b0| 09 74 6f 6f 6c 62 6f 78 | 20 63 61 6c 6c 73 20 61 |.toolbox| calls a| |000003c0| 6e 64 20 54 65 78 74 45 | 64 69 74 20 61 75 74 6f |nd TextE|dit auto| |000003d0| 73 63 72 6f 6c 6c 20 61 | 72 65 20 64 65 6d 6f 6e |scroll a|re demon| |000003e0| 73 74 72 61 74 65 64 2e | 20 49 74 20 0d 23 09 61 |strated.| It .#.a| |000003f0| 6c 73 6f 20 73 68 6f 77 | 73 20 68 6f 77 20 74 6f |lso show|s how to| |00000400| 20 63 72 65 61 74 65 20 | 61 6e 64 20 6d 61 69 6e | create |and main| |00000410| 74 61 69 6e 20 73 63 72 | 6f 6c 6c 62 61 72 20 63 |tain scr|ollbar c| |00000420| 6f 6e 74 72 6f 6c 73 20 | 61 73 20 77 65 6c 6c 0d |ontrols |as well.| |00000430| 23 09 61 73 20 69 6d 70 | 6c 65 6d 65 6e 74 69 6e |#.as imp|lementin| |00000440| 67 20 61 20 62 61 73 69 | 63 20 70 72 69 6e 74 69 |g a basi|c printi| |00000450| 6e 67 20 6c 6f 6f 70 2e | 0d 23 0d 23 09 49 74 20 |ng loop.|.#.#.It | |00000460| 64 6f 65 73 20 6e 6f 74 | 20 62 79 20 61 6e 79 20 |does not| by any | |00000470| 6d 65 61 6e 73 20 64 65 | 6d 6f 6e 73 74 72 61 74 |means de|monstrat| |00000480| 65 20 61 6c 6c 20 74 68 | 65 20 74 65 63 68 6e 69 |e all th|e techni| |00000490| 71 75 65 73 20 79 6f 75 | 20 0d 23 09 6e 65 65 64 |ques you| .#.need| |000004a0| 20 66 6f 72 20 61 20 6c | 61 72 67 65 20 61 70 70 | for a l|arge app| |000004b0| 6c 69 63 61 74 69 6f 6e | 2e 20 49 6e 20 70 61 72 |lication|. In par| |000004c0| 74 69 63 75 6c 61 72 2c | 20 54 45 53 74 79 6c 65 |ticular,| TEStyle| |000004d0| 53 61 6d 70 6c 65 20 64 | 6f 65 73 20 6e 6f 74 20 |Sample d|oes not | |000004e0| 0d 23 09 63 6f 76 65 72 | 20 65 78 63 65 70 74 69 |.#.cover| excepti| |000004f0| 6f 6e 20 68 61 6e 64 6c | 69 6e 67 2c 20 6d 75 6c |on handl|ing, mul| |00000500| 74 69 70 6c 65 20 77 69 | 6e 64 6f 77 73 2f 64 6f |tiple wi|ndows/do| |00000510| 63 75 6d 65 6e 74 73 2c | 20 0d 23 09 73 6f 70 68 |cuments,| .#.soph| |00000520| 69 73 74 69 63 61 74 65 | 64 20 6d 65 6d 6f 72 79 |isticate|d memory| |00000530| 20 6d 61 6e 61 67 65 6d | 65 6e 74 2c 20 6f 72 20 | managem|ent, or | |00000540| 75 6e 64 6f 2e 20 41 6c | 6c 20 6f 66 20 0d 23 09 |undo. Al|l of .#.| |00000550| 74 68 65 73 65 20 61 72 | 65 20 76 69 74 61 6c 20 |these ar|e vital | |00000560| 70 61 72 74 73 20 6f 66 | 20 61 20 6e 6f 72 6d 61 |parts of| a norma| |00000570| 6c 20 66 75 6c 6c 2d 73 | 69 7a 65 64 20 61 70 70 |l full-s|ized app| |00000580| 6c 69 63 61 74 69 6f 6e | 2e 0d 23 0d 23 09 54 68 |lication|..#.#.Th| |00000590| 69 73 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 69 |is appli|cation i| |000005a0| 73 20 61 6e 20 65 78 61 | 6d 70 6c 65 20 6f 66 20 |s an exa|mple of | |000005b0| 74 68 65 20 66 6f 72 6d | 20 6f 66 20 61 20 4d 61 |the form| of a Ma| |000005c0| 63 69 6e 74 6f 73 68 20 | 0d 23 09 61 70 70 6c 69 |cintosh |.#.appli| |000005d0| 63 61 74 69 6f 6e 3b 20 | 69 74 20 69 73 20 4e 4f |cation; |it is NO| |000005e0| 54 20 61 20 74 65 6d 70 | 6c 61 74 65 2e 20 49 74 |T a temp|late. It| |000005f0| 20 69 73 20 4e 4f 54 20 | 69 6e 74 65 6e 64 65 64 | is NOT |intended| |00000600| 20 74 6f 20 62 65 20 0d | 23 09 75 73 65 64 20 61 | to be .|#.used a| |00000610| 73 20 61 20 66 6f 75 6e | 64 61 74 69 6f 6e 20 66 |s a foun|dation f| |00000620| 6f 72 20 74 68 65 20 6e | 65 78 74 20 77 6f 72 6c |or the n|ext worl| |00000630| 64 2d 63 6c 61 73 73 2c | 20 62 65 73 74 2d 73 65 |d-class,| best-se| |00000640| 6c 6c 69 6e 67 2c 20 0d | 23 09 36 30 30 4b 20 61 |lling, .|#.600K a| |00000650| 70 70 6c 69 63 61 74 69 | 6f 6e 2e 20 41 20 73 74 |pplicati|on. A st| |00000660| 69 63 6b 20 66 69 67 75 | 72 65 20 64 72 61 77 69 |ick figu|re drawi| |00000670| 6e 67 20 6f 66 20 74 68 | 65 20 68 75 6d 61 6e 20 |ng of th|e human | |00000680| 62 6f 64 79 20 6d 61 79 | 20 0d 23 09 62 65 20 61 |body may| .#.be a| |00000690| 20 67 6f 6f 64 20 65 78 | 61 6d 70 6c 65 20 6f 66 | good ex|ample of| |000006a0| 20 74 68 65 20 66 6f 72 | 6d 20 66 6f 72 20 61 20 | the for|m for a | |000006b0| 70 61 69 6e 74 69 6e 67 | 2c 20 62 75 74 20 74 68 |painting|, but th| |000006c0| 61 74 20 64 6f 65 73 20 | 6e 6f 74 20 0d 23 09 6d |at does |not .#.m| |000006d0| 65 61 6e 20 69 74 20 73 | 68 6f 75 6c 64 20 62 65 |ean it s|hould be| |000006e0| 20 75 73 65 64 20 61 73 | 20 74 68 65 20 62 61 73 | used as| the bas| |000006f0| 69 73 20 66 6f 72 20 74 | 68 65 20 6e 65 78 74 20 |is for t|he next | |00000700| 4d 6f 6e 61 20 4c 69 73 | 61 2e 0d 23 0d 23 09 57 |Mona Lis|a..#.#.W| |00000710| 65 20 72 65 63 6f 6d 6d | 65 6e 64 20 74 68 61 74 |e recomm|end that| |00000720| 20 79 6f 75 20 72 65 76 | 69 65 77 20 74 68 69 73 | you rev|iew this| |00000730| 20 70 72 6f 67 72 61 6d | 2c 20 54 45 53 61 6d 70 | program|, TESamp| |00000740| 6c 65 20 6f 72 20 53 61 | 6d 70 6c 65 20 62 65 66 |le or Sa|mple bef| |00000750| 6f 72 65 20 0d 23 09 62 | 65 67 69 6e 6e 69 6e 67 |ore .#.b|eginning| |00000760| 20 61 20 6e 65 77 20 61 | 70 70 6c 69 63 61 74 69 | a new a|pplicati| |00000770| 6f 6e 2e 20 54 45 53 61 | 6d 70 6c 65 20 69 73 20 |on. TESa|mple is | |00000780| 61 20 73 69 6d 70 6c 65 | 72 20 76 65 72 73 69 6f |a simple|r versio| |00000790| 6e 20 6f 66 20 54 45 53 | 74 79 6c 65 53 61 6d 70 |n of TES|tyleSamp| |000007a0| 6c 65 0d 23 09 77 69 74 | 68 6f 75 74 20 73 74 79 |le.#.wit|hout sty| |000007b0| 6c 65 73 20 61 6e 64 20 | 53 61 6d 70 6c 65 20 69 |les and |Sample i| |000007c0| 73 20 61 20 73 69 6d 70 | 6c 65 20 61 70 70 2e 20 |s a simp|le app. | |000007d0| 77 68 69 63 68 20 64 6f | 65 73 6e d5 74 20 0d 23 |which do|esn.t .#| |000007e0| 09 75 73 65 20 54 65 78 | 74 45 64 69 74 20 6f 72 |.use Tex|tEdit or| |000007f0| 20 74 68 65 20 43 6f 6e | 74 72 6f 6c 20 4d 61 6e | the Con|trol Man| |00000800| 61 67 65 72 2e 0d 23 0d | 2d 2d 2d 2d 2d 2d 2d 2d |ager..#.|--------| |00000810| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------| |00000820| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------| |00000830| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------| |00000840| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------| |00000850| 2d 2d 2d 2d 2d 2d 7d 0d | 0d 0d 50 52 4f 47 52 41 |------}.|..PROGRA| |00000860| 4d 20 54 45 53 74 79 6c | 65 53 61 6d 70 6c 65 3b |M TEStyl|eSample;| |00000870| 0d 0d 7b 53 65 67 6d 65 | 6e 74 61 74 69 6f 6e 20 |..{Segme|ntation | |00000880| 73 74 72 61 74 65 67 79 | 3a 0d 0d 20 54 68 69 73 |strategy|:.. This| |00000890| 20 70 72 6f 67 72 61 6d | 20 63 6f 6e 73 69 73 74 | program| consist| |000008a0| 73 20 6f 66 20 74 68 72 | 65 65 20 73 65 67 6d 65 |s of thr|ee segme| |000008b0| 6e 74 73 2e 20 4d 61 69 | 6e 20 63 6f 6e 74 61 69 |nts. Mai|n contai| |000008c0| 6e 73 20 6d 6f 73 74 20 | 6f 66 20 74 68 65 20 63 |ns most |of the c| |000008d0| 6f 64 65 2c 0d 20 69 6e | 63 6c 75 64 69 6e 67 20 |ode,. in|cluding | |000008e0| 74 68 65 20 4d 50 57 20 | 6c 69 62 72 61 72 69 65 |the MPW |librarie| |000008f0| 73 2c 20 61 6e 64 20 74 | 68 65 20 6d 61 69 6e 20 |s, and t|he main | |00000900| 70 72 6f 67 72 61 6d 2e | 20 49 6e 69 74 69 61 6c |program.| Initial| |00000910| 69 7a 65 20 63 6f 6e 74 | 61 69 6e 73 0d 20 63 6f |ize cont|ains. co| |00000920| 64 65 20 74 68 61 74 20 | 69 73 20 6f 6e 6c 79 20 |de that |is only | |00000930| 75 73 65 64 20 6f 6e 63 | 65 2c 20 64 75 72 69 6e |used onc|e, durin| |00000940| 67 20 73 74 61 72 74 75 | 70 2c 20 61 6e 64 20 63 |g startu|p, and c| |00000950| 61 6e 20 62 65 20 75 6e | 6c 6f 61 64 65 64 20 61 |an be un|loaded a| |00000960| 66 74 65 72 20 74 68 65 | 0d 20 70 72 6f 67 72 61 |fter the|. progra| |00000970| 6d 20 73 74 61 72 74 73 | 2e 20 25 41 35 49 6e 69 |m starts|. %A5Ini| |00000980| 74 20 69 73 20 61 75 74 | 6f 6d 61 74 69 63 61 6c |t is aut|omatical| |00000990| 6c 79 20 63 72 65 61 74 | 65 64 20 62 79 20 74 68 |ly creat|ed by th| |000009a0| 65 20 4c 69 6e 6b 65 72 | 20 74 6f 20 69 6e 69 74 |e Linker| to init| |000009b0| 69 61 6c 69 7a 65 0d 20 | 67 6c 6f 62 61 6c 73 20 |ialize. |globals | |000009c0| 66 6f 72 20 74 68 65 20 | 4d 50 57 20 6c 69 62 72 |for the |MPW libr| |000009d0| 61 72 69 65 73 20 61 6e | 64 20 69 73 20 75 6e 6c |aries an|d is unl| |000009e0| 6f 61 64 65 64 20 72 69 | 67 68 74 20 61 77 61 79 |oaded ri|ght away| |000009f0| 2e 7d 0d 0d 0d 7b 53 65 | 74 50 6f 72 74 20 73 74 |.}...{Se|tPort st| |00000a00| 72 61 74 65 67 79 3a 0d | 0d 20 54 6f 6f 6c 62 6f |rategy:.|. Toolbo| |00000a10| 78 20 72 6f 75 74 69 6e | 65 73 20 64 6f 20 6e 6f |x routin|es do no| |00000a20| 74 20 63 68 61 6e 67 65 | 20 74 68 65 20 63 75 72 |t change| the cur| |00000a30| 72 65 6e 74 20 70 6f 72 | 74 2e 20 49 6e 20 73 70 |rent por|t. In sp| |00000a40| 69 74 65 20 6f 66 20 74 | 68 69 73 2c 20 69 6e 20 |ite of t|his, in | |00000a50| 74 68 69 73 0d 20 70 72 | 6f 67 72 61 6d 20 77 65 |this. pr|ogram we| |00000a60| 20 75 73 65 20 61 20 73 | 74 72 61 74 65 67 79 20 | use a s|trategy | |00000a70| 6f 66 20 63 61 6c 6c 69 | 6e 67 20 53 65 74 50 6f |of calli|ng SetPo| |00000a80| 72 74 20 77 68 65 6e 65 | 76 65 72 20 77 65 20 77 |rt whene|ver we w| |00000a90| 61 6e 74 20 74 6f 20 64 | 72 61 77 20 6f 72 0d 20 |ant to d|raw or. | |00000aa0| 6d 61 6b 65 20 63 61 6c | 6c 73 20 77 68 69 63 68 |make cal|ls which| |00000ab0| 20 64 65 70 65 6e 64 20 | 6f 6e 20 74 68 65 20 63 | depend |on the c| |00000ac0| 75 72 72 65 6e 74 20 70 | 6f 72 74 2e 20 54 68 69 |urrent p|ort. Thi| |00000ad0| 73 20 6d 61 6b 65 73 20 | 75 73 20 6c 65 73 73 20 |s makes |us less | |00000ae0| 76 75 6c 6e 65 72 61 62 | 6c 65 0d 20 74 6f 20 62 |vulnerab|le. to b| |00000af0| 75 67 73 20 69 6e 20 6f | 74 68 65 72 20 73 6f 66 |ugs in o|ther sof| |00000b00| 74 77 61 72 65 20 77 68 | 69 63 68 20 6d 69 67 68 |tware wh|ich migh| |00000b10| 74 20 61 6c 74 65 72 20 | 74 68 65 20 63 75 72 72 |t alter |the curr| |00000b20| 65 6e 74 20 70 6f 72 74 | 20 28 73 75 63 68 20 61 |ent port| (such a| |00000b30| 73 20 74 68 65 0d 20 62 | 75 67 20 28 66 65 61 74 |s the. b|ug (feat| |00000b40| 75 72 65 3f 29 20 69 6e | 20 6d 61 6e 79 20 64 65 |ure?) in| many de| |00000b50| 73 6b 20 61 63 63 65 73 | 73 6f 72 69 65 73 20 77 |sk acces|sories w| |00000b60| 68 69 63 68 20 63 68 61 | 6e 67 65 20 74 68 65 20 |hich cha|nge the | |00000b70| 70 6f 72 74 20 6f 6e 20 | 4f 70 65 6e 44 65 73 6b |port on |OpenDesk| |00000b80| 41 63 63 29 2e 0d 20 48 | 6f 70 65 66 75 6c 6c 79 |Acc).. H|opefully| |00000b90| 2c 20 74 68 69 73 20 61 | 6c 73 6f 20 6d 61 6b 65 |, this a|lso make| |00000ba0| 73 20 74 68 65 20 72 6f | 75 74 69 6e 65 73 20 66 |s the ro|utines f| |00000bb0| 72 6f 6d 20 74 68 69 73 | 20 70 72 6f 67 72 61 6d |rom this| program| |00000bc0| 20 6d 6f 72 65 20 73 65 | 6c 66 2d 63 6f 6e 74 61 | more se|lf-conta| |00000bd0| 69 6e 65 64 2c 0d 20 73 | 69 6e 63 65 20 74 68 65 |ined,. s|ince the| |00000be0| 79 20 64 6f 6e 27 74 20 | 64 65 70 65 6e 64 20 6f |y don't |depend o| |00000bf0| 6e 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 70 6f |n the cu|rrent po| |00000c00| 72 74 20 73 65 74 74 69 | 6e 67 2e 7d 0d 0d 0d 7b |rt setti|ng.}...{| |00000c10| 43 6c 69 70 62 6f 61 72 | 64 20 73 74 72 61 74 65 |Clipboar|d strate| |00000c20| 67 79 3a 20 0d 0d 20 55 | 6e 64 65 72 20 73 74 79 |gy: .. U|nder sty| |00000c30| 6c 65 64 20 54 65 78 74 | 45 64 69 74 2c 20 54 45 |led Text|Edit, TE| |00000c40| 43 75 74 20 61 6e 64 20 | 54 45 43 6f 70 79 20 77 |Cut and |TECopy w| |00000c50| 69 6c 6c 20 77 72 69 74 | 65 20 62 6f 74 68 20 74 |ill writ|e both t| |00000c60| 68 65 20 74 65 78 74 20 | 61 6e 64 20 61 73 73 6f |he text |and asso| |00000c70| 63 69 61 74 65 64 0d 20 | 73 74 79 6c 65 20 69 6e |ciated. |style in| |00000c80| 66 6f 72 6d 61 74 69 6f | 6e 20 64 69 72 65 63 74 |formatio|n direct| |00000c90| 6c 79 20 74 6f 20 74 68 | 65 20 64 65 73 6b 20 73 |ly to th|e desk s| |00000ca0| 63 72 61 70 20 61 73 20 | 74 79 70 65 73 20 27 54 |crap as |types 'T| |00000cb0| 45 58 54 27 20 61 6e 64 | 20 27 73 74 79 6c 27 2e |EXT' and| 'styl'.| |00000cc0| 0d 20 49 6e 73 74 65 61 | 64 20 6f 66 20 75 73 69 |. Instea|d of usi| |00000cd0| 6e 67 20 54 45 54 6f 53 | 63 72 61 70 20 61 6e 64 |ng TEToS|crap and| |00000ce0| 20 54 45 46 72 6f 6d 53 | 63 72 61 70 2c 20 61 20 | TEFromS|crap, a | |00000cf0| 6e 65 77 20 72 6f 75 74 | 69 6e 65 20 54 45 53 74 |new rout|ine TESt| |00000d00| 79 6c 50 61 73 74 65 2c | 20 77 69 6c 6c 20 0d 20 |ylPaste,| will . | |00000d10| 74 72 61 6e 73 66 65 72 | 20 74 68 65 20 74 65 78 |transfer| the tex| |00000d20| 74 20 61 6e 64 20 73 74 | 79 6c 65 20 66 72 6f 6d |t and st|yle from| |00000d30| 20 74 68 65 20 64 65 73 | 6b 20 73 63 72 61 70 20 | the des|k scrap | |00000d40| 74 6f 20 74 68 65 20 64 | 6f 63 75 6d 65 6e 74 2e |to the d|ocument.| |00000d50| 20 7d 0d 20 0d 7b 24 44 | 2b 7d 0d 0d 55 53 45 53 | }. .{$D|+}..USES| |00000d60| 0d 09 4d 65 6d 54 79 70 | 65 73 2c 20 51 75 69 63 |..MemTyp|es, Quic| |00000d70| 6b 44 72 61 77 2c 20 4f | 53 49 6e 74 66 2c 20 54 |kDraw, O|SIntf, T| |00000d80| 6f 6f 6c 49 6e 74 66 2c | 20 50 61 63 6b 49 6e 74 |oolIntf,| PackInt| |00000d90| 66 2c 20 54 72 61 70 73 | 2c 20 4d 61 63 50 72 69 |f, Traps|, MacPri| |00000da0| 6e 74 3b 0d 0d 43 4f 4e | 53 54 0d 0d 09 7b 6b 54 |nt;..CON|ST...{kT| |00000db0| 65 78 74 4d 61 72 67 69 | 6e 20 69 73 20 74 68 65 |extMargi|n is the| |00000dc0| 20 6e 75 6d 62 65 72 20 | 6f 66 20 70 69 78 65 6c | number |of pixel| |00000dd0| 73 20 77 65 20 6c 65 61 | 76 65 20 62 6c 61 6e 6b |s we lea|ve blank| |00000de0| 20 61 74 20 74 68 65 20 | 65 64 67 65 20 6f 66 20 | at the |edge of | |00000df0| 74 68 65 20 77 69 6e 64 | 6f 77 2e 7d 0d 09 6b 54 |the wind|ow.}..kT| |00000e00| 65 78 74 4d 61 72 67 69 | 6e 09 09 09 09 3d 20 32 |extMargi|n....= 2| |00000e10| 3b 0d 0d 09 7b 6b 4d 61 | 78 4f 70 65 6e 44 6f 63 |;...{kMa|xOpenDoc| |00000e20| 75 6d 65 6e 74 73 20 69 | 73 20 75 73 65 64 20 74 |uments i|s used t| |00000e30| 6f 20 64 65 74 65 72 6d | 69 6e 65 20 77 68 65 74 |o determ|ine whet| |00000e40| 68 65 72 20 61 20 6e 65 | 77 20 64 6f 63 75 6d 65 |her a ne|w docume| |00000e50| 6e 74 20 63 61 6e 20 62 | 65 20 6f 70 65 6e 65 64 |nt can b|e opened| |00000e60| 0d 09 20 6f 72 20 63 72 | 65 61 74 65 64 2e 20 57 |.. or cr|eated. W| |00000e70| 65 20 6b 65 65 70 20 74 | 72 61 63 6b 20 6f 66 20 |e keep t|rack of | |00000e80| 74 68 65 20 6e 75 6d 62 | 65 72 20 6f 66 20 6f 70 |the numb|er of op| |00000e90| 65 6e 20 64 6f 63 75 6d | 65 6e 74 73 2c 20 61 6e |en docum|ents, an| |00000ea0| 64 20 64 69 73 61 62 6c | 65 20 74 68 65 0d 09 20 |d disabl|e the.. | |00000eb0| 6d 65 6e 75 20 69 74 65 | 6d 73 20 74 68 61 74 20 |menu ite|ms that | |00000ec0| 63 72 65 61 74 65 20 61 | 20 6e 65 77 20 64 6f 63 |create a| new doc| |00000ed0| 75 6d 65 6e 74 20 77 68 | 65 6e 20 74 68 65 20 6d |ument wh|en the m| |00000ee0| 61 78 69 6d 75 6d 20 69 | 73 20 72 65 61 63 68 65 |aximum i|s reache| |00000ef0| 64 2e 20 49 66 20 74 68 | 65 0d 09 20 6e 75 6d 62 |d. If th|e.. numb| |00000f00| 65 72 20 6f 66 20 64 6f | 63 75 6d 65 6e 74 73 20 |er of do|cuments | |00000f10| 66 61 6c 6c 73 20 62 65 | 6c 6f 77 20 74 68 65 20 |falls be|low the | |00000f20| 6d 61 78 69 6d 75 6d 2c | 20 74 68 65 20 69 74 65 |maximum,| the ite| |00000f30| 6d 73 20 61 72 65 20 65 | 6e 61 62 6c 65 64 20 61 |ms are e|nabled a| |00000f40| 67 61 69 6e 2e 7d 0d 09 | 6b 4d 61 78 4f 70 65 6e |gain.}..|kMaxOpen| |00000f50| 44 6f 63 75 6d 65 6e 74 | 73 09 09 3d 20 31 3b 0d |Document|s..= 1;.| |00000f60| 09 0d 09 7b 6b 4d 61 78 | 44 6f 63 57 69 64 74 68 |...{kMax|DocWidth| |00000f70| 20 69 73 20 61 6e 20 61 | 72 62 69 74 72 61 72 79 | is an a|rbitrary| |00000f80| 20 6e 75 6d 62 65 72 20 | 75 73 65 64 20 74 6f 20 | number |used to | |00000f90| 73 70 65 63 69 66 79 20 | 74 68 65 20 77 69 64 74 |specify |the widt| |00000fa0| 68 20 6f 66 20 74 68 65 | 20 54 45 52 65 63 27 73 |h of the| TERec's| |00000fb0| 0d 09 64 65 73 74 69 6e | 61 74 69 6f 6e 20 72 65 |..destin|ation re| |00000fc0| 63 74 61 6e 67 6c 65 20 | 73 6f 20 74 68 61 74 20 |ctangle |so that | |00000fd0| 77 6f 72 64 20 77 72 61 | 70 20 61 6e 64 20 68 6f |word wra|p and ho| |00000fe0| 72 69 7a 6f 6e 74 61 6c | 20 73 63 72 6f 6c 6c 69 |rizontal| scrolli| |00000ff0| 6e 67 20 63 61 6e 20 62 | 65 0d 09 64 65 6d 6f 6e |ng can b|e..demon| |00001000| 73 74 72 61 74 65 64 2e | 7d 0d 09 6b 4d 61 78 44 |strated.|}..kMaxD| |00001010| 6f 63 57 69 64 74 68 09 | 09 09 3d 20 35 37 36 3b |ocWidth.|..= 576;| |00001020| 0d 09 0d 09 7b 6b 4d 69 | 6e 44 6f 63 44 69 6d 20 |....{kMi|nDocDim | |00001030| 69 73 20 75 73 65 64 20 | 74 6f 20 6c 69 6d 69 74 |is used |to limit| |00001040| 20 74 68 65 20 6d 69 6e | 69 6d 75 6d 20 64 69 6d | the min|imum dim| |00001050| 65 6e 73 69 6f 6e 20 6f | 66 20 61 20 77 69 6e 64 |ension o|f a wind| |00001060| 6f 77 20 77 68 65 6e 20 | 47 72 6f 77 57 69 6e 64 |ow when |GrowWind| |00001070| 6f 77 0d 09 69 73 20 63 | 61 6c 6c 65 64 2e 7d 0d |ow..is c|alled.}.| |00001080| 09 6b 4d 69 6e 44 6f 63 | 44 69 6d 09 09 09 09 3d |.kMinDoc|Dim....=| |00001090| 20 36 34 3b 0d 09 0d 09 | 7b 6b 43 6f 6e 74 72 6f | 64;....|{kContro| |000010a0| 6c 49 6e 76 69 73 69 62 | 6c 65 20 69 73 20 75 73 |lInvisib|le is us| |000010b0| 65 64 20 74 6f 20 27 74 | 75 72 6e 20 6f 66 66 27 |ed to 't|urn off'| |000010c0| 20 63 6f 6e 74 72 6f 6c | 73 20 28 69 2e 65 2e 2c | control|s (i.e.,| |000010d0| 20 63 61 75 73 65 20 74 | 68 65 20 63 6f 6e 74 72 | cause t|he contr| |000010e0| 6f 6c 20 6e 6f 74 0d 09 | 74 6f 20 62 65 20 72 65 |ol not..|to be re| |000010f0| 64 72 61 77 6e 20 61 73 | 20 61 20 72 65 73 75 6c |drawn as| a resul| |00001100| 74 20 6f 66 20 73 6f 6d | 65 20 43 6f 6e 74 72 6f |t of som|e Contro| |00001110| 6c 20 4d 61 6e 61 67 65 | 72 20 63 61 6c 6c 20 73 |l Manage|r call s| |00001120| 75 63 68 20 61 73 20 53 | 65 74 43 74 6c 56 61 6c |uch as S|etCtlVal| |00001130| 75 65 29 0d 09 62 79 20 | 62 65 69 6e 67 20 70 75 |ue)..by |being pu| |00001140| 74 20 69 6e 74 6f 20 74 | 68 65 20 63 6f 6e 74 72 |t into t|he contr| |00001150| 6c 56 69 73 20 66 69 65 | 6c 64 20 6f 66 20 74 68 |lVis fie|ld of th| |00001160| 65 20 72 65 63 6f 72 64 | 2e 20 6b 43 6f 6e 74 72 |e record|. kContr| |00001170| 6f 6c 56 69 73 69 62 6c | 65 20 69 73 20 75 73 65 |olVisibl|e is use| |00001180| 64 0d 09 74 68 65 20 73 | 61 6d 65 20 77 61 79 20 |d..the s|ame way | |00001190| 74 6f 20 27 74 75 72 6e | 20 6f 6e 27 20 74 68 65 |to 'turn| on' the| |000011a0| 20 63 6f 6e 74 72 6f 6c | 2e 7d 0d 09 6b 43 6f 6e | control|.}..kCon| |000011b0| 74 72 6f 6c 49 6e 76 69 | 73 69 62 6c 65 09 09 3d |trolInvi|sible..=| |000011c0| 20 30 3b 0d 09 6b 43 6f | 6e 74 72 6f 6c 56 69 73 | 0;..kCo|ntrolVis| |000011d0| 69 62 6c 65 09 09 09 3d | 20 24 46 46 3b 0d 0d 09 |ible...=| $FF;...| |000011e0| 7b 6b 53 63 72 6f 6c 6c | 42 61 72 41 64 6a 75 73 |{kScroll|BarAdjus| |000011f0| 74 20 61 6e 64 20 6b 53 | 63 72 6f 6c 6c 42 61 72 |t and kS|crollBar| |00001200| 57 69 64 74 68 20 61 72 | 65 20 75 73 65 64 20 69 |Width ar|e used i| |00001210| 6e 20 63 61 6c 63 75 6c | 61 74 69 6e 67 0d 09 76 |n calcul|ating..v| |00001220| 61 6c 75 65 73 20 66 6f | 72 20 63 6f 6e 74 72 6f |alues fo|r contro| |00001230| 6c 20 70 6f 73 69 74 69 | 6f 6e 69 6e 67 20 61 6e |l positi|oning an| |00001240| 64 20 73 69 7a 69 6e 67 | 2e 7d 0d 09 6b 53 63 72 |d sizing|.}..kScr| |00001250| 6f 6c 6c 62 61 72 57 69 | 64 74 68 09 09 09 3d 20 |ollbarWi|dth...= | |00001260| 31 36 3b 0d 09 6b 53 63 | 72 6f 6c 6c 62 61 72 41 |16;..kSc|rollbarA| |00001270| 64 6a 75 73 74 09 09 3d | 20 6b 53 63 72 6f 6c 6c |djust..=| kScroll| |00001280| 62 61 72 57 69 64 74 68 | 20 2d 20 31 3b 0d 0d 09 |barWidth| - 1;...| |00001290| 7b 6b 53 63 72 6f 6c 6c | 54 77 65 65 6b 20 63 6f |{kScroll|Tweek co| |000012a0| 6d 70 65 6e 73 61 74 65 | 73 20 66 6f 72 20 6f 66 |mpensate|s for of| |000012b0| 66 2d 62 79 2d 6f 6e 65 | 20 72 65 71 75 69 72 65 |f-by-one| require| |000012c0| 6d 65 6e 74 73 20 6f 66 | 20 74 68 65 20 73 63 72 |ments of| the scr| |000012d0| 6f 6c 6c 62 61 72 73 0d | 20 09 74 6f 20 68 61 76 |ollbars.| .to hav| |000012e0| 65 20 62 6f 72 64 65 72 | 73 20 63 6f 69 6e 63 69 |e border|s coinci| |000012f0| 64 65 20 77 69 74 68 20 | 74 68 65 20 67 72 6f 77 |de with |the grow| |00001300| 62 6f 78 2e 7d 0d 09 6b | 53 63 72 6f 6c 6c 54 77 |box.}..k|ScrollTw| |00001310| 65 65 6b 09 09 09 3d 20 | 32 3b 0d 0d 09 7b 6b 43 |eek...= |2;...{kC| |00001320| 72 43 68 61 72 20 69 73 | 20 75 73 65 64 20 74 6f |rChar is| used to| |00001330| 20 6d 61 74 63 68 20 77 | 69 74 68 20 61 20 63 61 | match w|ith a ca| |00001340| 72 72 69 61 67 65 20 72 | 65 74 75 72 6e 20 77 68 |rriage r|eturn wh| |00001350| 65 6e 20 63 61 6c 63 75 | 6c 61 74 69 6e 67 20 74 |en calcu|lating t| |00001360| 68 65 0d 09 6e 75 6d 62 | 65 72 20 6f 66 20 6c 69 |he..numb|er of li| |00001370| 6e 65 73 20 69 6e 20 74 | 68 65 20 54 65 78 74 45 |nes in t|he TextE| |00001380| 64 69 74 20 72 65 63 6f | 72 64 2e 20 6b 44 65 6c |dit reco|rd. kDel| |00001390| 43 68 61 72 20 69 73 20 | 75 73 65 64 20 74 6f 20 |Char is |used to | |000013a0| 63 68 65 63 6b 20 66 6f | 72 0d 09 64 65 6c 65 74 |check fo|r..delet| |000013b0| 65 20 69 6e 20 6b 65 79 | 44 6f 77 6e 73 2e 7d 0d |e in key|Downs.}.| |000013c0| 09 6b 43 52 43 68 61 72 | 09 09 09 09 09 3d 20 31 |.kCRChar|.....= 1| |000013d0| 33 3b 0d 09 6b 44 65 6c | 43 68 61 72 09 09 09 09 |3;..kDel|Char....| |000013e0| 3d 20 38 3b 0d 0d 09 7b | 6b 42 75 74 74 6f 6e 53 |= 8;...{|kButtonS| |000013f0| 63 72 6f 6c 6c 20 69 73 | 20 68 6f 77 20 6d 61 6e |croll is| how man| |00001400| 79 20 70 69 78 65 6c 73 | 20 74 6f 20 73 63 72 6f |y pixels| to scro| |00001410| 6c 6c 20 68 6f 72 69 7a | 6f 6e 74 61 6c 6c 79 20 |ll horiz|ontally | |00001420| 77 68 65 6e 20 74 68 65 | 20 62 75 74 74 6f 6e 20 |when the| button | |00001430| 70 61 72 74 0d 09 6f 66 | 20 74 68 65 20 68 6f 72 |part..of| the hor| |00001440| 69 7a 6f 6e 74 61 6c 20 | 73 63 72 6f 6c 6c 62 61 |izontal |scrollba| |00001450| 72 20 69 73 20 70 72 65 | 73 73 65 64 2e 7d 0d 09 |r is pre|ssed.}..| |00001460| 6b 42 75 74 74 6f 6e 53 | 63 72 6f 6c 6c 09 09 09 |kButtonS|croll...| |00001470| 3d 20 34 3b 0d 09 0d 09 | 7b 6b 4d 61 78 54 45 4c |= 4;....|{kMaxTEL| |00001480| 65 6e 67 74 68 20 69 73 | 20 61 6e 20 61 72 62 69 |ength is| an arbi| |00001490| 74 72 61 72 79 20 6e 75 | 6d 62 65 72 20 75 73 65 |trary nu|mber use| |000014a0| 64 20 74 6f 20 6c 69 6d | 69 74 20 74 68 65 20 6c |d to lim|it the l| |000014b0| 65 6e 67 74 68 20 6f 66 | 20 74 65 78 74 20 69 6e |ength of| text in| |000014c0| 20 74 68 65 20 54 45 52 | 65 63 0d 09 73 6f 20 74 | the TER|ec..so t| |000014d0| 68 61 74 20 76 61 72 69 | 6f 75 73 20 65 72 72 6f |hat vari|ous erro| |000014e0| 72 73 20 77 6f 6e 27 74 | 20 6f 63 63 75 72 20 66 |rs won't| occur f| |000014f0| 72 6f 6d 20 74 6f 6f 20 | 6d 61 6e 79 20 63 68 61 |rom too |many cha| |00001500| 72 61 63 74 65 72 73 20 | 69 6e 20 74 68 65 20 74 |racters |in the t| |00001510| 65 78 74 2e 7d 0d 09 6b | 4d 61 78 54 45 4c 65 6e |ext.}..k|MaxTELen| |00001520| 67 74 68 09 09 09 3d 20 | 33 32 30 30 30 3b 0d 09 |gth...= |32000;..| |00001530| 28 2a 20 77 68 61 74 20 | 61 62 6f 75 74 20 74 68 |(* what |about th| |00001540| 61 74 20 74 65 63 68 20 | 6e 6f 74 65 20 49 20 77 |at tech |note I w| |00001550| 72 6f 74 65 3f 20 69 73 | 20 74 68 69 73 20 61 20 |rote? is| this a | |00001560| 76 61 6c 69 64 20 63 68 | 65 63 6b 20 61 6e 79 6d |valid ch|eck anym| |00001570| 6f 72 65 3f 20 6d 61 77 | 20 2a 29 0d 0d 09 7b 6b |ore? maw| *)...{k| |00001580| 53 79 73 45 6e 76 69 72 | 6f 6e 73 56 65 72 73 69 |SysEnvir|onsVersi| |00001590| 6f 6e 20 69 73 20 70 61 | 73 73 65 64 20 74 6f 20 |on is pa|ssed to | |000015a0| 53 79 73 45 6e 76 69 72 | 6f 6e 73 20 74 6f 20 74 |SysEnvir|ons to t| |000015b0| 65 6c 6c 20 69 74 20 77 | 68 69 63 68 20 76 65 72 |ell it w|hich ver| |000015c0| 73 69 6f 6e 20 6f 66 20 | 74 68 65 0d 09 20 53 79 |sion of |the.. Sy| |000015d0| 73 45 6e 76 52 65 63 20 | 77 65 20 75 6e 64 65 72 |sEnvRec |we under| |000015e0| 73 74 61 6e 64 2e 7d 0d | 09 6b 53 79 73 45 6e 76 |stand.}.|.kSysEnv| |000015f0| 69 72 6f 6e 73 56 65 72 | 73 69 6f 6e 09 09 3d 20 |ironsVer|sion..= | |00001600| 31 3b 0d 0d 09 7b 6b 4f | 53 45 76 65 6e 74 20 69 |1;...{kO|SEvent i| |00001610| 73 20 74 68 65 20 65 76 | 65 6e 74 20 6e 75 6d 62 |s the ev|ent numb| |00001620| 65 72 20 6f 66 20 74 68 | 65 20 73 75 73 70 65 6e |er of th|e suspen| |00001630| 64 2f 72 65 73 75 6d 65 | 20 61 6e 64 20 6d 6f 75 |d/resume| and mou| |00001640| 73 65 2d 6d 6f 76 65 64 | 20 65 76 65 6e 74 73 20 |se-moved| events | |00001650| 73 65 6e 74 0d 09 20 62 | 79 20 4d 75 6c 74 69 46 |sent.. b|y MultiF| |00001660| 69 6e 64 65 72 2e 20 4f | 6e 63 65 20 77 65 20 64 |inder. O|nce we d| |00001670| 65 74 65 72 6d 69 6e 65 | 20 74 68 61 74 20 61 6e |etermine| that an| |00001680| 20 65 76 65 6e 74 20 69 | 73 20 61 6e 20 6f 73 45 | event i|s an osE| |00001690| 76 65 6e 74 2c 20 77 65 | 20 6c 6f 6f 6b 20 61 74 |vent, we| look at| |000016a0| 20 74 68 65 0d 09 20 68 | 69 67 68 20 62 79 74 65 | the.. h|igh byte| |000016b0| 20 6f 66 20 74 68 65 20 | 6d 65 73 73 61 67 65 20 | of the |message | |000016c0| 73 65 6e 74 20 74 6f 20 | 64 65 74 65 72 6d 69 6e |sent to |determin| |000016d0| 65 20 77 68 69 63 68 20 | 6b 69 6e 64 20 69 74 20 |e which |kind it | |000016e0| 69 73 2e 20 54 6f 20 64 | 69 66 66 65 72 65 6e 74 |is. To d|ifferent| |000016f0| 69 61 74 65 0d 09 20 73 | 75 73 70 65 6e 64 20 61 |iate.. s|uspend a| |00001700| 6e 64 20 72 65 73 75 6d | 65 20 65 76 65 6e 74 73 |nd resum|e events| |00001710| 20 77 65 20 63 68 65 63 | 6b 20 74 68 65 20 72 65 | we chec|k the re| |00001720| 73 75 6d 65 4d 61 73 6b | 20 62 69 74 2e 7d 0d 09 |sumeMask| bit.}..| |00001730| 6b 4f 53 45 76 65 6e 74 | 09 09 09 09 3d 20 61 70 |kOSEvent|....= ap| |00001740| 70 34 45 76 74 3b 09 7b | 20 65 76 65 6e 74 20 75 |p4Evt;.{| event u| |00001750| 73 65 64 20 62 79 20 4d | 75 6c 74 69 46 69 6e 64 |sed by M|ultiFind| |00001760| 65 72 20 7d 0d 09 6b 53 | 75 73 70 65 6e 64 52 65 |er }..kS|uspendRe| |00001770| 73 75 6d 65 4d 65 73 73 | 61 67 65 09 3d 20 31 3b |sumeMess|age.= 1;| |00001780| 09 09 7b 20 68 69 67 68 | 20 62 79 74 65 20 6f 66 |..{ high| byte of| |00001790| 20 73 75 73 70 65 6e 64 | 2f 72 65 73 75 6d 65 20 | suspend|/resume | |000017a0| 65 76 65 6e 74 20 6d 65 | 73 73 61 67 65 20 7d 0d |event me|ssage }.| |000017b0| 09 6b 52 65 73 75 6d 65 | 4d 61 73 6b 09 09 09 09 |.kResume|Mask....| |000017c0| 3d 20 31 3b 09 09 7b 20 | 62 69 74 20 6f 66 20 6d |= 1;..{ |bit of m| |000017d0| 65 73 73 61 67 65 20 66 | 69 65 6c 64 20 66 6f 72 |essage f|ield for| |000017e0| 20 72 65 73 75 6d 65 20 | 76 73 2e 20 73 75 73 70 | resume |vs. susp| |000017f0| 65 6e 64 20 7d 0d 09 6b | 4d 6f 75 73 65 4d 6f 76 |end }..k|MouseMov| |00001800| 65 64 4d 65 73 73 61 67 | 65 09 09 3d 20 24 46 41 |edMessag|e..= $FA| |00001810| 3b 09 09 7b 20 68 69 67 | 68 20 62 79 74 65 20 6f |;..{ hig|h byte o| |00001820| 66 20 6d 6f 75 73 65 2d | 6d 6f 76 65 64 20 65 76 |f mouse-|moved ev| |00001830| 65 6e 74 20 6d 65 73 73 | 61 67 65 20 7d 0d 09 6b |ent mess|age }..k| |00001840| 4e 6f 45 76 65 6e 74 73 | 09 09 09 09 3d 20 30 3b |NoEvents|....= 0;| |00001850| 09 09 7b 6e 6f 20 65 76 | 65 6e 74 73 20 6d 61 73 |..{no ev|ents mas| |00001860| 6b 7d 0d 0d 09 7b 6b 4d | 69 6e 48 65 61 70 20 2d |k}...{kM|inHeap -| |00001870| 20 54 68 69 73 20 69 73 | 20 74 68 65 20 6d 69 6e | This is| the min| |00001880| 69 6d 75 6d 20 72 65 73 | 75 6c 74 20 66 72 6f 6d |imum res|ult from| |00001890| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 0d 09 | the fol|lowing..| |000018a0| 20 65 71 75 61 74 69 6f | 6e 3a 0d 09 09 09 0d 09 | equatio|n:......| |000018b0| 09 09 4f 52 44 28 47 65 | 74 41 70 70 6c 4c 69 6d |..ORD(Ge|tApplLim| |000018c0| 69 74 29 20 2d 20 4f 52 | 44 28 41 70 70 6c 69 63 |it) - OR|D(Applic| |000018d0| 5a 6f 6e 65 29 0d 09 09 | 09 0d 09 20 66 6f 72 20 |Zone)...|... for | |000018e0| 74 68 65 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |the appl|ication | |000018f0| 74 6f 20 72 75 6e 2e 20 | 49 74 20 77 69 6c 6c 20 |to run. |It will | |00001900| 69 6e 73 75 72 65 20 74 | 68 61 74 20 65 6e 6f 75 |insure t|hat enou| |00001910| 67 68 20 6d 65 6d 6f 72 | 79 20 77 69 6c 6c 0d 09 |gh memor|y will..| |00001920| 20 62 65 20 61 72 6f 75 | 6e 64 20 66 6f 72 20 72 | be arou|nd for r| |00001930| 65 61 73 6f 6e 61 62 6c | 65 2d 73 69 7a 65 64 20 |easonabl|e-sized | |00001940| 73 63 72 61 70 73 2c 20 | 46 4b 45 59 73 2c 20 65 |scraps, |FKEYs, e| |00001950| 74 63 2e 20 74 6f 20 65 | 78 69 73 74 20 77 69 74 |tc. to e|xist wit| |00001960| 68 20 74 68 65 0d 09 20 | 61 70 70 6c 69 63 61 74 |h the.. |applicat| |00001970| 69 6f 6e 2c 20 61 6e 64 | 20 73 74 69 6c 6c 20 67 |ion, and| still g| |00001980| 69 76 65 20 74 68 65 20 | 61 70 70 6c 69 63 61 74 |ive the |applicat| |00001990| 69 6f 6e 20 73 6f 6d 65 | 20 27 62 72 65 61 74 68 |ion some| 'breath| |000019a0| 69 6e 67 20 72 6f 6f 6d | 27 2e 0d 09 20 54 6f 20 |ing room|'... To | |000019b0| 64 65 72 69 76 65 20 74 | 68 69 73 20 6e 75 6d 62 |derive t|his numb| |000019c0| 65 72 2c 20 77 65 20 72 | 61 6e 20 75 6e 64 65 72 |er, we r|an under| |000019d0| 20 61 20 4d 75 6c 74 69 | 46 69 6e 64 65 72 20 70 | a Multi|Finder p| |000019e0| 61 72 74 69 74 69 6f 6e | 20 74 68 61 74 20 77 61 |artition| that wa| |000019f0| 73 0d 09 20 6f 75 72 20 | 72 65 71 75 65 73 74 65 |s.. our |requeste| |00001a00| 64 20 6d 69 6e 69 6d 75 | 6d 20 73 69 7a 65 2c 20 |d minimu|m size, | |00001a10| 61 73 20 67 69 76 65 6e | 20 69 6e 20 74 68 65 20 |as given| in the | |00001a20| 27 53 49 5a 45 27 20 72 | 65 73 6f 75 72 63 65 2e |'SIZE' r|esource.| |00001a30| 7d 0d 09 20 0d 09 6b 4d | 69 6e 48 65 61 70 09 3d |}.. ..kM|inHeap.=| |00001a40| 20 32 39 20 2a 20 31 30 | 32 34 3b 20 0d 0d 09 7b | 29 * 10|24; ...{| |00001a50| 6b 4d 69 6e 53 70 61 63 | 65 20 2d 20 54 68 69 73 |kMinSpac|e - This| |00001a60| 20 69 73 20 74 68 65 20 | 6d 69 6e 69 6d 75 6d 20 | is the |minimum | |00001a70| 72 65 73 75 6c 74 20 66 | 72 6f 6d 20 50 75 72 67 |result f|rom Purg| |00001a80| 65 53 70 61 63 65 2c 20 | 77 68 65 6e 20 63 61 6c |eSpace, |when cal| |00001a90| 6c 65 64 0d 09 20 61 74 | 20 69 6e 69 74 69 61 6c |led.. at| initial| |00001aa0| 69 7a 61 74 69 6f 6e 20 | 74 69 6d 65 2c 20 66 6f |ization |time, fo| |00001ab0| 72 20 74 68 65 20 61 70 | 70 6c 69 63 61 74 69 6f |r the ap|plicatio| |00001ac0| 6e 20 74 6f 20 72 75 6e | 2e 20 54 68 69 73 20 6e |n to run|. This n| |00001ad0| 75 6d 62 65 72 20 61 63 | 74 73 0d 09 20 61 73 20 |umber ac|ts.. as | |00001ae0| 61 20 64 6f 75 62 6c 65 | 2d 63 68 65 63 6b 20 74 |a double|-check t| |00001af0| 6f 20 69 6e 73 75 72 65 | 20 74 68 61 74 20 74 68 |o insure| that th| |00001b00| 65 72 65 20 72 65 61 6c | 6c 79 20 69 73 20 65 6e |ere real|ly is en| |00001b10| 6f 75 67 68 20 6d 65 6d | 6f 72 79 20 66 6f 72 20 |ough mem|ory for | |00001b20| 74 68 65 0d 09 20 61 70 | 70 6c 69 63 61 74 69 6f |the.. ap|plicatio| |00001b30| 6e 20 74 6f 20 72 75 6e | 2c 20 69 6e 63 6c 75 64 |n to run|, includ| |00001b40| 69 6e 67 20 77 68 61 74 | 20 68 61 73 20 62 65 65 |ing what| has bee| |00001b50| 6e 20 74 61 6b 65 6e 20 | 75 70 20 61 6c 72 65 61 |n taken |up alrea| |00001b60| 64 79 20 62 79 0d 09 20 | 70 72 65 2d 6c 6f 61 64 |dy by.. |pre-load| |00001b70| 65 64 20 72 65 73 6f 75 | 72 63 65 73 2c 20 74 68 |ed resou|rces, th| |00001b80| 65 20 73 63 72 61 70 2c | 20 63 6f 64 65 2c 20 61 |e scrap,| code, a| |00001b90| 6e 64 20 6f 74 68 65 72 | 20 73 75 6e 64 72 79 20 |nd other| sundry | |00001ba0| 6d 65 6d 6f 72 79 20 62 | 6c 6f 63 6b 73 2e 7d 0d |memory b|locks.}.| |00001bb0| 09 20 0d 09 6b 4d 69 6e | 53 70 61 63 65 09 3d 20 |. ..kMin|Space.= | |00001bc0| 32 30 20 2a 20 31 30 32 | 34 3b 0d 09 0d 09 7b 6b |20 * 102|4;....{k| |00001bd0| 45 78 74 72 65 6d 65 4e | 65 67 20 61 6e 64 20 6b |ExtremeN|eg and k| |00001be0| 45 78 74 72 65 6d 65 50 | 6f 73 20 61 72 65 20 75 |ExtremeP|os are u| |00001bf0| 73 65 64 20 74 6f 20 73 | 65 74 20 75 70 20 77 69 |sed to s|et up wi| |00001c00| 64 65 20 6f 70 65 6e 20 | 72 65 63 74 61 6e 67 6c |de open |rectangl| |00001c10| 65 73 20 61 6e 64 20 72 | 65 67 69 6f 6e 73 2e 7d |es and r|egions.}| |00001c20| 0d 09 6b 45 78 74 72 65 | 6d 65 4e 65 67 09 09 3d |..kExtre|meNeg..=| |00001c30| 20 2d 33 32 37 36 38 3b | 0d 09 6b 45 78 74 72 65 | -32768;|..kExtre| |00001c40| 6d 65 50 6f 73 09 09 3d | 20 33 32 37 36 37 20 2d |mePos..=| 32767 -| |00001c50| 20 31 3b 09 7b 20 72 65 | 71 75 69 72 65 64 20 66 | 1;.{ re|quired f| |00001c60| 6f 72 20 6f 6c 64 20 72 | 65 67 69 6f 6e 20 62 75 |or old r|egion bu| |00001c70| 67 20 7d 0d 09 0d 09 7b | 6b 54 45 53 6c 6f 70 20 |g }....{|kTESlop | |00001c80| 70 72 6f 76 69 64 65 73 | 20 73 6f 6d 65 20 65 78 |provides| some ex| |00001c90| 74 72 61 20 73 65 63 75 | 72 69 74 79 20 77 68 65 |tra secu|rity whe| |00001ca0| 6e 20 70 72 65 2d 66 6c | 69 67 68 74 69 6e 67 20 |n pre-fl|ighting | |00001cb0| 65 64 69 74 20 63 6f 6d | 6d 61 6e 64 73 2e 7d 0d |edit com|mands.}.| |00001cc0| 09 6b 54 45 53 6c 6f 70 | 09 09 09 3d 20 31 30 32 |.kTESlop|...= 102| |00001cd0| 34 3b 0d 0d 09 7b 6b 45 | 72 72 53 74 72 69 6e 67 |4;...{kE|rrString| |00001ce0| 73 20 69 73 20 74 68 65 | 20 72 65 73 6f 75 72 63 |s is the| resourc| |00001cf0| 65 20 49 44 20 66 6f 72 | 20 74 68 65 20 65 72 72 |e ID for| the err| |00001d00| 6f 72 20 73 74 72 69 6e | 67 73 20 53 54 52 23 20 |or strin|gs STR# | |00001d10| 72 65 73 6f 75 72 63 65 | 2e 7d 0d 09 6b 45 72 72 |resource|.}..kErr| |00001d20| 53 74 72 69 6e 67 73 09 | 09 3d 20 31 32 38 3b 0d |Strings.|.= 128;.| |00001d30| 0d 09 7b 20 54 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |..{ The |followin| |00001d40| 67 20 61 72 65 20 69 6e | 64 69 63 69 65 73 20 69 |g are in|dicies i| |00001d50| 6e 74 6f 20 53 54 52 23 | 20 72 65 73 6f 75 72 63 |nto STR#| resourc| |00001d60| 65 73 2e 20 7d 0d 09 65 | 57 72 6f 6e 67 4d 61 63 |es. }..e|WrongMac| |00001d70| 68 69 6e 65 09 3d 20 31 | 3b 0d 09 65 53 6d 61 6c |hine.= 1|;..eSmal| |00001d80| 6c 53 69 7a 65 09 09 3d | 20 32 3b 0d 09 65 4e 6f |lSize..=| 2;..eNo| |00001d90| 4d 65 6d 6f 72 79 09 09 | 3d 20 33 3b 0d 09 65 4e |Memory..|= 3;..eN| |00001da0| 6f 53 70 61 63 65 43 75 | 74 09 09 3d 20 34 3b 0d |oSpaceCu|t..= 4;.| |00001db0| 09 65 4e 6f 43 75 74 09 | 09 09 3d 20 35 3b 0d 09 |.eNoCut.|..= 5;..| |00001dc0| 65 4e 6f 43 6f 70 79 09 | 09 09 3d 20 36 3b 0d 09 |eNoCopy.|..= 6;..| |00001dd0| 65 45 78 63 65 65 64 50 | 61 73 74 65 09 3d 20 37 |eExceedP|aste.= 7| |00001de0| 3b 0d 09 65 4e 6f 53 70 | 61 63 65 50 61 73 74 65 |;..eNoSp|acePaste| |00001df0| 09 3d 20 38 3b 0d 09 65 | 4e 6f 57 69 6e 64 6f 77 |.= 8;..e|NoWindow| |00001e00| 09 09 3d 20 39 3b 0d 09 | 65 45 78 63 65 65 64 43 |..= 9;..|eExceedC| |00001e10| 68 61 72 09 09 3d 20 31 | 30 3b 0d 09 65 4e 6f 50 |har..= 1|0;..eNoP| |00001e20| 61 73 74 65 09 09 3d 20 | 31 31 3b 0d 09 0d 09 0d |aste..= |11;.....| |00001e30| 09 7b 20 54 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |.{ The f|ollowing| |00001e40| 20 63 6f 6e 73 74 61 6e | 74 73 20 61 72 65 20 61 | constan|ts are a| |00001e50| 6c 6c 20 72 65 73 6f 75 | 72 63 65 20 49 44 73 2c |ll resou|rce IDs,| |00001e60| 20 63 6f 72 72 65 73 70 | 6f 6e 64 69 6e 67 20 74 | corresp|onding t| |00001e70| 6f 20 74 68 65 69 72 20 | 72 65 73 6f 75 72 63 65 |o their |resource| |00001e80| 73 20 7d 0d 09 0d 09 72 | 4d 65 6e 75 42 61 72 09 |s }....r|MenuBar.| |00001e90| 3d 20 31 32 38 3b 09 09 | 09 09 7b 20 61 70 70 6c |= 128;..|..{ appl| |00001ea0| 69 63 61 74 69 6f 6e 27 | 73 20 6d 65 6e 75 20 62 |ication'|s menu b| |00001eb0| 61 72 20 7d 0d 09 72 41 | 62 6f 75 74 41 6c 65 72 |ar }..rA|boutAler| |00001ec0| 74 09 3d 20 31 32 38 3b | 09 09 09 09 7b 20 61 62 |t.= 128;|....{ ab| |00001ed0| 6f 75 74 20 61 6c 65 72 | 74 20 7d 0d 09 72 55 73 |out aler|t }..rUs| |00001ee0| 65 72 41 6c 65 72 74 09 | 3d 20 31 32 39 3b 09 09 |erAlert.|= 129;..| |00001ef0| 09 09 7b 20 75 73 65 72 | 20 65 72 72 6f 72 20 61 |..{ user| error a| |00001f00| 6c 65 72 74 20 7d 0d 09 | 72 44 6f 63 57 69 6e 64 |lert }..|rDocWind| |00001f10| 6f 77 09 3d 20 31 32 38 | 3b 09 09 09 09 7b 20 61 |ow.= 128|;....{ a| |00001f20| 70 70 6c 69 63 61 74 69 | 6f 6e 27 73 20 77 69 6e |pplicati|on's win| |00001f30| 64 6f 77 20 7d 0d 09 0d | 09 72 56 53 63 72 6f 6c |dow }...|.rVScrol| |00001f40| 6c 09 3d 20 31 32 38 3b | 09 09 09 09 7b 20 76 65 |l.= 128;|....{ ve| |00001f50| 72 74 69 63 61 6c 20 73 | 63 72 6f 6c 6c 62 61 72 |rtical s|crollbar| |00001f60| 20 63 6f 6e 74 72 6f 6c | 20 7d 0d 09 72 48 53 63 | control| }..rHSc| |00001f70| 72 6f 6c 6c 09 3d 20 31 | 32 39 3b 09 09 09 09 7b |roll.= 1|29;....{| |00001f80| 20 68 6f 72 69 7a 6f 6e | 74 61 6c 20 73 63 72 6f | horizon|tal scro| |00001f90| 6c 6c 62 61 72 20 63 6f | 6e 74 72 6f 6c 20 7d 0d |llbar co|ntrol }.| |00001fa0| 0d 0d 09 7b 20 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |...{ The| followi| |00001fb0| 6e 67 20 63 6f 6e 73 74 | 61 6e 74 73 20 61 72 65 |ng const|ants are| |00001fc0| 20 61 6c 6c 20 6d 65 6e | 75 20 61 6e 64 20 69 74 | all men|u and it| |00001fd0| 65 6d 20 49 44 73 20 63 | 6f 72 72 65 73 70 6f 6e |em IDs c|orrespon| |00001fe0| 64 69 6e 67 20 74 6f 20 | 74 68 65 69 72 20 72 65 |ding to |their re| |00001ff0| 73 6f 75 72 63 65 73 20 | 7d 0d 09 0d 09 6d 41 70 |sources |}....mAp| |00002000| 70 6c 65 09 09 3d 20 31 | 32 38 3b 09 09 09 09 7b |ple..= 1|28;....{| |00002010| 20 41 70 70 6c 65 20 6d | 65 6e 75 20 7d 0d 09 69 | Apple m|enu }..i| |00002020| 41 62 6f 75 74 09 09 3d | 20 31 3b 0d 0d 09 6d 46 |About..=| 1;...mF| |00002030| 69 6c 65 09 09 3d 20 31 | 32 39 3b 09 09 09 09 7b |ile..= 1|29;....{| |00002040| 20 46 69 6c 65 20 6d 65 | 6e 75 20 7d 0d 09 69 4e | File me|nu }..iN| |00002050| 65 77 09 09 3d 20 31 3b | 0d 09 69 43 6c 6f 73 65 |ew..= 1;|..iClose| |00002060| 09 09 3d 20 34 3b 0d 09 | 69 50 61 67 65 53 65 74 |..= 4;..|iPageSet| |00002070| 75 70 09 3d 20 39 3b 09 | 09 09 09 7b 20 41 64 64 |up.= 9;.|...{ Add| |00002080| 65 64 20 66 6f 72 20 54 | 45 53 74 79 6c 65 53 61 |ed for T|EStyleSa| |00002090| 6d 70 6c 65 20 7d 0d 09 | 69 50 72 69 6e 74 09 09 |mple }..|iPrint..| |000020a0| 3d 20 31 30 3b 09 09 09 | 09 7b 20 41 64 64 65 64 |= 10;...|.{ Added| |000020b0| 20 66 6f 72 20 54 45 53 | 74 79 6c 65 53 61 6d 70 | for TES|tyleSamp| |000020c0| 6c 65 20 7d 0d 09 69 51 | 75 69 74 09 09 3d 20 31 |le }..iQ|uit..= 1| |000020d0| 32 3b 0d 0d 09 6d 45 64 | 69 74 09 09 3d 20 31 33 |2;...mEd|it..= 13| |000020e0| 30 3b 09 09 09 09 7b 20 | 45 64 69 74 20 6d 65 6e |0;....{ |Edit men| |000020f0| 75 20 7d 0d 09 69 55 6e | 64 6f 09 09 3d 20 31 3b |u }..iUn|do..= 1;| |00002100| 0d 09 69 43 75 74 09 09 | 3d 20 33 3b 0d 09 69 43 |..iCut..|= 3;..iC| |00002110| 6f 70 79 09 09 3d 20 34 | 3b 0d 09 69 50 61 73 74 |opy..= 4|;..iPast| |00002120| 65 09 09 3d 20 35 3b 0d | 09 69 43 6c 65 61 72 09 |e..= 5;.|.iClear.| |00002130| 09 3d 20 36 3b 0d 09 69 | 53 65 6c 65 63 74 41 6c |.= 6;..i|SelectAl| |00002140| 6c 09 3d 20 38 3b 09 09 | 09 09 7b 20 41 64 64 65 |l.= 8;..|..{ Adde| |00002150| 64 20 66 6f 72 20 54 45 | 53 74 79 6c 65 53 61 6d |d for TE|StyleSam| |00002160| 70 6c 65 20 7d 0d 09 0d | 09 6d 46 6f 6e 74 20 09 |ple }...|.mFont .| |00002170| 09 3d 20 31 33 31 3b 09 | 09 09 09 7b 20 46 6f 6e |.= 131;.|...{ Fon| |00002180| 74 20 6d 65 6e 75 2d 61 | 64 64 65 64 20 66 6f 72 |t menu-a|dded for| |00002190| 20 54 45 53 74 79 6c 65 | 53 61 6d 70 6c 65 20 7d | TEStyle|Sample }| |000021a0| 0d 09 0d 09 6d 46 6f 6e | 74 53 69 7a 65 20 09 3d |....mFon|tSize .=| |000021b0| 20 31 33 32 3b 09 09 09 | 09 7b 20 46 6f 6e 74 20 | 132;...|.{ Font | |000021c0| 73 69 7a 65 20 6d 65 6e | 75 2d 61 64 64 65 64 20 |size men|u-added | |000021d0| 66 6f 72 20 54 45 53 74 | 79 6c 65 53 61 6d 70 6c |for TESt|yleSampl| |000021e0| 65 20 7d 0d 09 69 4e 69 | 6e 65 09 09 3d 20 31 3b |e }..iNi|ne..= 1;| |000021f0| 0d 09 69 54 65 6e 09 09 | 3d 20 32 3b 0d 09 69 54 |..iTen..|= 2;..iT| |00002200| 77 65 6c 76 65 09 09 3d | 20 33 3b 0d 09 69 46 6f |welve..=| 3;..iFo| |00002210| 75 72 74 65 65 6e 09 3d | 20 34 3b 0d 09 69 45 69 |urteen.=| 4;..iEi| |00002220| 67 68 74 65 65 6e 09 3d | 20 35 3b 0d 09 69 54 77 |ghteen.=| 5;..iTw| |00002230| 6f 46 6f 75 72 09 3d 20 | 36 3b 0d 09 0d 09 6d 53 |oFour.= |6;....mS| |00002240| 74 79 6c 65 20 09 09 3d | 20 31 33 33 3b 09 09 09 |tyle ..=| 133;...| |00002250| 09 7b 20 53 74 79 6c 65 | 20 6d 65 6e 75 2d 61 64 |.{ Style| menu-ad| |00002260| 64 65 64 20 66 6f 72 20 | 54 45 53 74 79 6c 65 53 |ded for |TEStyleS| |00002270| 61 6d 70 6c 65 20 7d 0d | 09 69 50 6c 61 69 6e 20 |ample }.|.iPlain | |00002280| 09 09 3d 20 31 3b 0d 09 | 69 42 6f 6c 64 20 09 09 |..= 1;..|iBold ..| |00002290| 3d 20 33 3b 0d 09 69 49 | 74 61 6c 69 63 09 09 3d |= 3;..iI|talic..=| |000022a0| 20 34 3b 0d 09 69 55 6e | 64 65 72 6c 69 6e 65 20 | 4;..iUn|derline | |000022b0| 09 3d 20 35 3b 0d 09 69 | 4f 75 74 6c 69 6e 65 20 |.= 5;..i|Outline | |000022c0| 09 3d 20 36 3b 0d 09 69 | 53 68 61 64 6f 77 20 09 |.= 6;..i|Shadow .| |000022d0| 3d 20 37 3b 20 0d 09 0d | 09 7b 6b 44 49 54 6f 70 |= 7; ...|.{kDITop| |000022e0| 20 61 6e 64 20 6b 44 49 | 4c 65 66 74 20 61 72 65 | and kDI|Left are| |000022f0| 20 75 73 65 64 20 74 6f | 20 6c 6f 63 61 74 65 20 | used to| locate | |00002300| 74 68 65 20 44 69 73 6b | 20 49 6e 69 74 69 61 6c |the Disk| Initial| |00002310| 69 7a 61 74 69 6f 6e 20 | 64 69 61 6c 6f 67 73 2e |ization |dialogs.| |00002320| 7d 0d 09 6b 44 49 54 6f | 70 09 09 3d 20 24 30 30 |}..kDITo|p..= $00| |00002330| 35 30 3b 0d 09 6b 44 49 | 4c 65 66 74 09 09 3d 20 |50;..kDI|Left..= | |00002340| 24 30 30 37 30 3b 0d 0d | 09 0d 54 59 50 45 0d 09 |$0070;..|..TYPE..| |00002350| 7b 41 20 44 6f 63 75 6d | 65 6e 74 52 65 63 6f 72 |{A Docum|entRecor| |00002360| 64 20 63 6f 6e 74 61 69 | 6e 73 20 74 68 65 20 57 |d contai|ns the W| |00002370| 69 6e 64 6f 77 52 65 63 | 6f 72 64 20 66 6f 72 20 |indowRec|ord for | |00002380| 6f 6e 65 20 6f 66 20 6f | 75 72 20 64 6f 63 75 6d |one of o|ur docum| |00002390| 65 6e 74 20 77 69 6e 64 | 6f 77 73 2c 0d 09 20 61 |ent wind|ows,.. a| |000023a0| 73 20 77 65 6c 6c 20 61 | 73 20 74 68 65 20 54 45 |s well a|s the TE| |000023b0| 48 61 6e 64 6c 65 20 66 | 6f 72 20 74 68 65 20 74 |Handle f|or the t| |000023c0| 65 78 74 20 77 65 20 61 | 72 65 20 65 64 69 74 69 |ext we a|re editi| |000023d0| 6e 67 2e 20 57 65 20 68 | 61 76 65 20 61 64 64 65 |ng. We h|ave adde| |000023e0| 64 20 66 69 65 6c 64 73 | 20 74 6f 0d 09 20 68 6f |d fields| to.. ho| |000023f0| 6c 64 20 74 68 65 20 43 | 6f 6e 74 72 6f 6c 48 61 |ld the C|ontrolHa| |00002400| 6e 64 6c 65 73 20 74 6f | 20 74 68 65 20 76 65 72 |ndles to| the ver| |00002410| 74 69 63 61 6c 20 61 6e | 64 20 68 6f 72 69 7a 6f |tical an|d horizo| |00002420| 6e 74 61 6c 20 73 63 72 | 6f 6c 6c 62 61 72 73 20 |ntal scr|ollbars | |00002430| 61 6e 64 20 74 6f 20 68 | 6f 6c 64 0d 09 20 74 68 |and to h|old.. th| |00002440| 65 20 61 64 64 72 65 73 | 73 20 6f 66 20 74 68 65 |e addres|s of the| |00002450| 20 64 65 66 61 75 6c 74 | 20 63 6c 69 6b 4c 6f 6f | default| clikLoo| |00002460| 70 20 74 68 61 74 20 67 | 65 74 73 20 61 74 74 61 |p that g|ets atta| |00002470| 63 68 65 64 20 74 6f 20 | 61 20 54 45 52 65 63 20 |ched to |a TERec | |00002480| 77 68 65 6e 20 79 6f 75 | 20 63 61 6c 6c 0d 09 20 |when you| call.. | |00002490| 54 45 41 75 74 6f 56 69 | 65 77 2e 20 4f 74 68 65 |TEAutoVi|ew. Othe| |000024a0| 72 20 64 6f 63 75 6d 65 | 6e 74 20 66 69 65 6c 64 |r docume|nt field| |000024b0| 73 20 63 61 6e 20 62 65 | 20 61 64 64 65 64 20 74 |s can be| added t| |000024c0| 6f 20 74 68 69 73 20 72 | 65 63 6f 72 64 20 61 73 |o this r|ecord as| |000024d0| 20 6e 65 65 64 65 64 2e | 20 46 6f 72 0d 09 20 61 | needed.| For.. a| |000024e0| 20 73 69 6d 69 6c 61 72 | 20 65 78 61 6d 70 6c 65 | similar| example| |000024f0| 2c 20 73 65 65 20 68 6f | 77 20 74 68 65 20 57 69 |, see ho|w the Wi| |00002500| 6e 64 6f 77 20 4d 61 6e | 61 67 65 72 20 61 6e 64 |ndow Man|ager and| |00002510| 20 44 69 61 6c 6f 67 20 | 4d 61 6e 61 67 65 72 20 | Dialog |Manager | |00002520| 61 64 64 20 66 69 65 6c | 64 73 0d 09 20 61 66 74 |add fiel|ds.. aft| |00002530| 65 72 20 74 68 65 20 47 | 72 61 66 50 6f 72 74 2e |er the G|rafPort.| |00002540| 7d 0d 09 44 6f 63 75 6d | 65 6e 74 52 65 63 6f 72 |}..Docum|entRecor| |00002550| 64 09 09 3d 20 52 45 43 | 4f 52 44 0d 09 09 64 6f |d..= REC|ORD...do| |00002560| 63 57 69 6e 64 6f 77 09 | 09 3a 20 57 69 6e 64 6f |cWindow.|.: Windo| |00002570| 77 52 65 63 6f 72 64 3b | 0d 09 09 64 6f 63 54 45 |wRecord;|...docTE| |00002580| 09 09 09 3a 20 54 45 48 | 61 6e 64 6c 65 3b 0d 09 |...: TEH|andle;..| |00002590| 09 64 6f 63 56 53 63 72 | 6f 6c 6c 09 09 3a 20 43 |.docVScr|oll..: C| |000025a0| 6f 6e 74 72 6f 6c 48 61 | 6e 64 6c 65 3b 0d 09 09 |ontrolHa|ndle;...| |000025b0| 64 6f 63 48 53 63 72 6f | 6c 6c 09 09 3a 20 43 6f |docHScro|ll..: Co| |000025c0| 6e 74 72 6f 6c 48 61 6e | 64 6c 65 3b 0d 09 09 64 |ntrolHan|dle;...d| |000025d0| 6f 63 43 6c 69 6b 09 09 | 09 3a 20 50 72 6f 63 50 |ocClik..|.: ProcP| |000025e0| 74 72 3b 0d 09 45 4e 44 | 3b 0d 09 44 6f 63 75 6d |tr;..END|;..Docum| |000025f0| 65 6e 74 50 65 65 6b 09 | 09 3d 20 5e 44 6f 63 75 |entPeek.|.= ^Docu| |00002600| 6d 65 6e 74 52 65 63 6f | 72 64 3b 0d 0d 0d 56 41 |mentReco|rd;...VA| |00002610| 52 0d 09 7b 54 68 65 20 | 22 67 22 20 70 72 65 66 |R..{The |"g" pref| |00002620| 69 78 20 69 73 20 75 73 | 65 64 20 74 6f 20 65 6d |ix is us|ed to em| |00002630| 70 68 61 73 69 7a 65 20 | 74 68 61 74 20 61 20 76 |phasize |that a v| |00002640| 61 72 69 61 62 6c 65 20 | 69 73 20 67 6c 6f 62 61 |ariable |is globa| |00002650| 6c 2e 7d 0d 09 67 4d 61 | 63 09 09 09 09 3a 20 53 |l.}..gMa|c....: S| |00002660| 79 73 45 6e 76 52 65 63 | 3b 09 7b 20 73 65 74 20 |ysEnvRec|;.{ set | |00002670| 75 70 20 62 79 20 49 6e | 69 74 69 61 6c 69 7a 65 |up by In|itialize| |00002680| 20 7d 0d 09 67 48 61 73 | 57 61 69 74 4e 65 78 74 | }..gHas|WaitNext| |00002690| 45 76 65 6e 74 09 3a 20 | 42 4f 4f 4c 45 41 4e 3b |Event.: |BOOLEAN;| |000026a0| 09 09 7b 20 73 65 74 20 | 75 70 20 62 79 20 49 6e |..{ set |up by In| |000026b0| 69 74 69 61 6c 69 7a 65 | 20 7d 0d 09 67 49 6e 42 |itialize| }..gInB| |000026c0| 61 63 6b 67 72 6f 75 6e | 64 09 09 3a 20 42 4f 4f |ackgroun|d..: BOO| |000026d0| 4c 45 41 4e 3b 09 09 7b | 20 6d 61 69 6e 74 61 69 |LEAN;..{| maintai| |000026e0| 6e 65 64 20 62 79 20 49 | 6e 69 74 69 61 6c 69 7a |ned by I|nitializ| |000026f0| 65 20 61 6e 64 20 44 6f | 45 76 65 6e 74 20 7d 0d |e and Do|Event }.| |00002700| 09 67 4e 75 6d 44 6f 63 | 75 6d 65 6e 74 73 09 09 |.gNumDoc|uments..| |00002710| 3a 20 49 4e 54 45 47 45 | 52 3b 09 09 7b 20 6d 61 |: INTEGE|R;..{ ma| |00002720| 69 6e 74 61 69 6e 65 64 | 20 62 79 20 49 6e 69 74 |intained| by Init| |00002730| 69 61 6c 69 7a 65 2c 20 | 44 6f 4e 65 77 2c 20 61 |ialize, |DoNew, a| |00002740| 6e 64 20 44 6f 43 6c 6f | 73 65 57 69 6e 64 6f 77 |nd DoClo|seWindow| |00002750| 20 7d 0d 09 0d 09 7b 4e | 65 77 20 67 6c 6f 62 61 | }....{N|ew globa| |00002760| 6c 73 20 74 6f 20 73 75 | 70 70 6f 72 74 20 70 72 |ls to su|pport pr| |00002770| 69 6e 74 69 6e 67 20 61 | 6e 64 20 73 74 79 6c 65 |inting a|nd style| |00002780| 20 73 65 6c 65 63 74 69 | 6f 6e 20 7d 0d 09 67 54 | selecti|on }..gT| |00002790| 78 53 74 79 6c 65 20 09 | 09 09 3a 20 54 65 78 74 |xStyle .|..: Text| |000027a0| 53 74 79 6c 65 3b 09 7b | 20 68 6f 6c 64 73 20 73 |Style;.{| holds s| |000027b0| 74 79 6c 65 20 73 65 6c | 65 63 74 65 64 2c 20 70 |tyle sel|ected, p| |000027c0| 6c 61 69 6e 20 64 65 66 | 61 75 6c 74 2c 20 6d 61 |lain def|ault, ma| |000027d0| 69 6e 74 61 69 6e 65 64 | 20 62 79 20 44 6f 4d 65 |intained| by DoMe| |000027e0| 6e 75 43 6f 6d 6d 61 6e | 64 20 7d 0d 09 67 46 6f |nuComman|d }..gFo| |000027f0| 6e 74 4e 61 6d 65 20 09 | 09 09 3a 20 53 74 72 32 |ntName .|..: Str2| |00002800| 35 35 3b 09 09 7b 20 6e | 61 6d 65 20 6f 66 20 66 |55;..{ n|ame of f| |00002810| 6f 6e 74 20 73 65 6c 65 | 63 74 65 64 2c 20 61 70 |ont sele|cted, ap| |00002820| 70 20 66 6f 6e 74 20 64 | 65 66 61 75 6c 74 2c 20 |p font d|efault, | |00002830| 6d 61 69 6e 74 61 69 6e | 65 64 20 62 79 20 44 6f |maintain|ed by Do| |00002840| 4d 65 6e 75 43 6f 6d 6d | 61 6e 64 20 7d 0d 09 67 |MenuComm|and }..g| |00002850| 46 6f 6e 74 49 44 20 09 | 09 09 3a 20 49 4e 54 45 |FontID .|..: INTE| |00002860| 47 45 52 3b 09 09 7b 20 | 49 44 20 6f 66 20 66 6f |GER;..{ |ID of fo| |00002870| 6e 74 20 73 65 6c 65 63 | 74 65 64 2c 20 61 70 70 |nt selec|ted, app| |00002880| 20 66 6f 6e 74 20 64 65 | 66 61 75 6c 74 2c 20 6d | font de|fault, m| |00002890| 61 69 6e 74 61 69 6e 65 | 64 20 62 79 20 44 6f 4d |aintaine|d by DoM| |000028a0| 65 6e 75 43 6f 6d 6d 61 | 6e 64 20 7d 0d 09 67 46 |enuComma|nd }..gF| |000028b0| 6f 6e 74 53 69 7a 65 20 | 09 09 09 3a 20 4c 4f 4e |ontSize |...: LON| |000028c0| 47 49 4e 54 3b 09 09 7b | 20 66 6f 6e 74 20 73 69 |GINT;..{| font si| |000028d0| 7a 65 20 73 65 6c 65 63 | 74 65 64 2c 20 31 32 20 |ze selec|ted, 12 | |000028e0| 70 74 20 64 65 66 61 75 | 6c 74 2c 20 6d 61 69 6e |pt defau|lt, main| |000028f0| 74 61 69 6e 65 64 20 62 | 79 20 44 6f 4d 65 6e 75 |tained b|y DoMenu| |00002900| 43 6f 6d 6d 61 6e 64 20 | 7d 0d 09 67 50 72 69 6e |Command |}..gPrin| |00002910| 74 65 72 52 65 63 6f 72 | 64 09 09 3a 20 54 48 50 |terRecor|d..: THP| |00002920| 72 69 6e 74 3b 09 09 7b | 20 70 72 69 6e 74 20 68 |rint;..{| print h| |00002930| 61 6e 64 6c 65 2c 20 6d | 61 69 6e 74 61 69 6e 65 |andle, m|aintaine| |00002940| 64 20 62 79 20 70 72 69 | 6e 74 54 65 78 74 20 7d |d by pri|ntText }| |00002950| 0d 09 67 50 72 69 6e 74 | 65 72 50 6f 72 74 09 09 |..gPrint|erPort..| |00002960| 3a 20 54 50 50 72 50 6f | 72 74 3b 09 09 7b 20 70 |: TPPrPo|rt;..{ p| |00002970| 6f 69 6e 74 65 72 20 74 | 6f 20 50 72 69 6e 74 20 |ointer t|o Print | |00002980| 4d 61 6e 61 67 65 72 27 | 73 20 47 72 61 66 50 6f |Manager'|s GrafPo| |00002990| 72 74 20 7d 0d 0d 0d 0d | 7b 24 53 20 49 6e 69 74 |rt }....|{$S Init| |000029a0| 69 61 6c 69 7a 65 7d 0d | 46 55 4e 43 54 49 4f 4e |ialize}.|FUNCTION| |000029b0| 20 54 72 61 70 41 76 61 | 69 6c 61 62 6c 65 28 74 | TrapAva|ilable(t| |000029c0| 4e 75 6d 62 65 72 3a 20 | 49 4e 54 45 47 45 52 3b |Number: |INTEGER;| |000029d0| 20 74 54 79 70 65 3a 20 | 54 72 61 70 54 79 70 65 | tType: |TrapType| |000029e0| 29 3a 20 42 4f 4f 4c 45 | 41 4e 3b 0d 0d 7b 43 68 |): BOOLE|AN;..{Ch| |000029f0| 65 63 6b 20 74 6f 20 73 | 65 65 20 69 66 20 61 20 |eck to s|ee if a | |00002a00| 67 69 76 65 6e 20 74 72 | 61 70 20 69 73 20 69 6d |given tr|ap is im| |00002a10| 70 6c 65 6d 65 6e 74 65 | 64 2e 20 54 68 69 73 20 |plemente|d. This | |00002a20| 69 73 20 6f 6e 6c 79 20 | 75 73 65 64 20 62 79 20 |is only |used by | |00002a30| 74 68 65 0d 20 49 6e 69 | 74 69 61 6c 69 7a 65 20 |the. Ini|tialize | |00002a40| 72 6f 75 74 69 6e 65 20 | 69 6e 20 74 68 69 73 20 |routine |in this | |00002a50| 70 72 6f 67 72 61 6d 2c | 20 73 6f 20 77 65 20 70 |program,| so we p| |00002a60| 75 74 20 69 74 20 69 6e | 20 74 68 65 20 49 6e 69 |ut it in| the Ini| |00002a70| 74 69 61 6c 69 7a 65 20 | 73 65 67 6d 65 6e 74 2e |tialize |segment.| |00002a80| 0d 20 54 68 65 20 72 65 | 63 6f 6d 6d 65 6e 64 65 |. The re|commende| |00002a90| 64 20 61 70 70 72 6f 61 | 63 68 20 74 6f 20 73 65 |d approa|ch to se| |00002aa0| 65 20 69 66 20 61 20 74 | 72 61 70 20 69 73 20 69 |e if a t|rap is i| |00002ab0| 6d 70 6c 65 6d 65 6e 74 | 65 64 20 69 73 20 74 6f |mplement|ed is to| |00002ac0| 20 73 65 65 20 69 66 0d | 20 74 68 65 20 61 64 64 | see if.| the add| |00002ad0| 72 65 73 73 20 6f 66 20 | 74 68 65 20 74 72 61 70 |ress of |the trap| |00002ae0| 20 72 6f 75 74 69 6e 65 | 20 69 73 20 74 68 65 20 | routine| is the | |00002af0| 73 61 6d 65 20 61 73 20 | 74 68 65 20 61 64 64 72 |same as |the addr| |00002b00| 65 73 73 20 6f 66 20 74 | 68 65 0d 20 55 6e 69 6d |ess of t|he. Unim| |00002b10| 70 6c 65 6d 65 6e 74 65 | 64 20 74 72 61 70 2e 7d |plemente|d trap.}| |00002b20| 0d 7b 4e 65 65 64 73 20 | 74 6f 20 62 65 20 63 61 |.{Needs |to be ca| |00002b30| 6c 6c 65 64 20 61 66 74 | 65 72 20 63 61 6c 6c 20 |lled aft|er call | |00002b40| 74 6f 20 53 79 73 45 6e | 76 69 72 6f 6e 73 20 73 |to SysEn|virons s| |00002b50| 6f 20 74 68 61 74 20 69 | 74 20 63 61 6e 20 63 68 |o that i|t can ch| |00002b60| 65 63 6b 0d 20 69 66 20 | 61 20 54 6f 6f 6c 54 72 |eck. if |a ToolTr| |00002b70| 61 70 20 69 73 20 6f 75 | 74 20 6f 66 20 72 61 6e |ap is ou|t of ran| |00002b80| 67 65 20 6f 66 20 61 20 | 70 72 65 2d 4d 61 63 49 |ge of a |pre-MacI| |00002b90| 49 20 52 4f 4d 2e 7d 0d | 0d 42 45 47 49 4e 0d 09 |I ROM.}.|.BEGIN..| |00002ba0| 49 46 20 28 74 54 79 70 | 65 20 3d 20 54 6f 6f 6c |IF (tTyp|e = Tool| |00002bb0| 54 72 61 70 29 20 26 0d | 09 09 28 67 4d 61 63 2e |Trap) &.|..(gMac.| |00002bc0| 6d 61 63 68 69 6e 65 54 | 79 70 65 20 3e 20 65 6e |machineT|ype > en| |00002bd0| 76 4d 61 63 68 55 6e 6b | 6e 6f 77 6e 29 20 26 0d |vMachUnk|nown) &.| |00002be0| 09 09 28 67 4d 61 63 2e | 6d 61 63 68 69 6e 65 54 |..(gMac.|machineT| |00002bf0| 79 70 65 20 3c 20 65 6e | 76 4d 61 63 49 49 29 20 |ype < en|vMacII) | |00002c00| 54 48 45 4e 20 42 45 47 | 49 4e 09 09 7b 69 74 27 |THEN BEG|IN..{it'| |00002c10| 73 20 61 20 35 31 32 4b | 45 2c 20 50 6c 75 73 2c |s a 512K|E, Plus,| |00002c20| 20 6f 72 20 53 45 7d 0d | 09 09 74 4e 75 6d 62 65 | or SE}.|..tNumbe| |00002c30| 72 20 3a 3d 20 42 41 4e | 44 28 74 4e 75 6d 62 65 |r := BAN|D(tNumbe| |00002c40| 72 2c 20 24 30 33 46 46 | 29 3b 0d 09 09 49 46 20 |r, $03FF|);...IF | |00002c50| 74 4e 75 6d 62 65 72 20 | 3e 20 24 30 31 46 46 20 |tNumber |> $01FF | |00002c60| 54 48 45 4e 09 09 09 09 | 09 09 09 7b 77 68 69 63 |THEN....|...{whic| |00002c70| 68 20 6d 65 61 6e 73 20 | 74 68 65 20 74 6f 6f 6c |h means |the tool| |00002c80| 20 74 72 61 70 73 7d 0d | 09 09 09 74 4e 75 6d 62 | traps}.|...tNumb| |00002c90| 65 72 20 3a 3d 20 5f 55 | 6e 69 6d 70 6c 65 6d 65 |er := _U|nimpleme| |00002ca0| 6e 74 65 64 3b 09 09 09 | 09 09 7b 6f 6e 6c 79 20 |nted;...|..{only | |00002cb0| 67 6f 20 74 6f 20 24 30 | 31 46 46 7d 0d 09 45 4e |go to $0|1FF}..EN| |00002cc0| 44 3b 0d 09 54 72 61 70 | 41 76 61 69 6c 61 62 6c |D;..Trap|Availabl| |00002cd0| 65 20 3a 3d 20 4e 47 65 | 74 54 72 61 70 41 64 64 |e := NGe|tTrapAdd| |00002ce0| 72 65 73 73 28 74 4e 75 | 6d 62 65 72 2c 20 74 54 |ress(tNu|mber, tT| |00002cf0| 79 70 65 29 20 3c 3e 0d | 09 09 09 09 09 09 47 65 |ype) <>.|......Ge| |00002d00| 74 54 72 61 70 41 64 64 | 72 65 73 73 28 5f 55 6e |tTrapAdd|ress(_Un| |00002d10| 69 6d 70 6c 65 6d 65 6e | 74 65 64 29 3b 0d 45 4e |implemen|ted);.EN| |00002d20| 44 3b 20 7b 54 72 61 70 | 41 76 61 69 6c 61 62 6c |D; {Trap|Availabl| |00002d30| 65 7d 0d 0d 0d 7b 24 53 | 20 4d 61 69 6e 7d 0d 46 |e}...{$S| Main}.F| |00002d40| 55 4e 43 54 49 4f 4e 20 | 49 73 44 41 57 69 6e 64 |UNCTION |IsDAWind| |00002d50| 6f 77 28 20 77 69 6e 64 | 6f 77 20 3a 20 57 69 6e |ow( wind|ow : Win| |00002d60| 64 6f 77 50 74 72 20 29 | 20 3a 20 42 4f 4f 4c 45 |dowPtr )| : BOOLE| |00002d70| 41 4e 3b 0d 0d 7b 20 20 | 43 68 65 63 6b 20 69 66 |AN;..{ |Check if| |00002d80| 20 61 20 77 69 6e 64 6f | 77 20 62 65 6c 6f 6e 67 | a windo|w belong| |00002d90| 73 20 74 6f 20 61 20 64 | 65 73 6b 20 61 63 63 65 |s to a d|esk acce| |00002da0| 73 73 6f 72 79 2e 20 7d | 0d 0d 42 45 47 49 4e 20 |ssory. }|..BEGIN | |00002db0| 7b 20 49 73 44 41 57 69 | 6e 64 6f 77 20 7d 0d 09 |{ IsDAWi|ndow }..| |00002dc0| 49 46 20 77 69 6e 64 6f | 77 20 3d 20 4e 49 4c 20 |IF windo|w = NIL | |00002dd0| 54 48 45 4e 0d 09 09 49 | 73 44 41 57 69 6e 64 6f |THEN...I|sDAWindo| |00002de0| 77 20 3a 3d 20 46 41 4c | 53 45 0d 09 45 4c 53 45 |w := FAL|SE..ELSE| |00002df0| 09 7b 20 44 41 20 77 69 | 6e 64 6f 77 73 20 68 61 |.{ DA wi|ndows ha| |00002e00| 76 65 20 6e 65 67 61 74 | 69 76 65 20 77 69 6e 64 |ve negat|ive wind| |00002e10| 6f 77 4b 69 6e 64 73 20 | 7d 0d 09 09 49 73 44 41 |owKinds |}...IsDA| |00002e20| 57 69 6e 64 6f 77 20 3a | 3d 20 57 69 6e 64 6f 77 |Window :|= Window| |00002e30| 50 65 65 6b 28 20 77 69 | 6e 64 6f 77 20 29 5e 2e |Peek( wi|ndow )^.| |00002e40| 77 69 6e 64 6f 77 4b 69 | 6e 64 20 3c 20 30 3b 0d |windowKi|nd < 0;.| |00002e50| 45 4e 44 3b 20 7b 20 49 | 73 44 41 57 69 6e 64 6f |END; { I|sDAWindo| |00002e60| 77 20 7d 0d 0d 0d 0d 7b | 24 53 20 4d 61 69 6e 7d |w }....{|$S Main}| |00002e70| 0d 46 55 4e 43 54 49 4f | 4e 20 49 73 41 70 70 57 |.FUNCTIO|N IsAppW| |00002e80| 69 6e 64 6f 77 28 20 77 | 69 6e 64 6f 77 20 3a 20 |indow( w|indow : | |00002e90| 57 69 6e 64 6f 77 50 74 | 72 20 29 20 3a 20 42 4f |WindowPt|r ) : BO| |00002ea0| 4f 4c 45 41 4e 3b 0d 0d | 7b 20 20 43 68 65 63 6b |OLEAN;..|{ Check| |00002eb0| 20 69 66 20 61 20 77 69 | 6e 64 6f 77 20 62 65 6c | if a wi|ndow bel| |00002ec0| 6f 6e 67 73 20 74 6f 20 | 74 68 65 20 61 70 70 6c |ongs to |the appl| |00002ed0| 69 63 61 74 69 6f 6e 2e | 20 7d 0d 0d 42 45 47 49 |ication.| }..BEGI| |00002ee0| 4e 20 7b 20 49 73 41 70 | 70 57 69 6e 64 6f 77 20 |N { IsAp|pWindow | |00002ef0| 7d 0d 09 49 46 20 77 69 | 6e 64 6f 77 20 3d 20 4e |}..IF wi|ndow = N| |00002f00| 49 4c 20 54 48 45 4e 0d | 09 09 49 73 41 70 70 57 |IL THEN.|..IsAppW| |00002f10| 69 6e 64 6f 77 20 3a 3d | 20 46 41 4c 53 45 0d 09 |indow :=| FALSE..| |00002f20| 45 4c 53 45 09 7b 20 61 | 70 70 6c 69 63 61 74 69 |ELSE.{ a|pplicati| |00002f30| 6f 6e 20 77 69 6e 64 6f | 77 73 20 68 61 76 65 20 |on windo|ws have | |00002f40| 6e 6f 6e 2d 6e 65 67 61 | 74 69 76 65 20 77 69 6e |non-nega|tive win| |00002f50| 64 6f 77 4b 69 6e 64 73 | 20 7d 0d 09 09 49 73 41 |dowKinds| }...IsA| |00002f60| 70 70 57 69 6e 64 6f 77 | 20 3a 3d 20 57 69 6e 64 |ppWindow| := Wind| |00002f70| 6f 77 50 65 65 6b 28 20 | 77 69 6e 64 6f 77 20 29 |owPeek( |window )| |00002f80| 5e 2e 77 69 6e 64 6f 77 | 4b 69 6e 64 20 3e 3d 20 |^.window|Kind >= | |00002f90| 30 3b 0d 45 4e 44 3b 20 | 7b 20 49 73 41 70 70 57 |0;.END; |{ IsAppW| |00002fa0| 69 6e 64 6f 77 20 7d 0d | 0d 0d 0d 7b 24 53 20 4d |indow }.|...{$S M| |00002fb0| 61 69 6e 7d 0d 50 52 4f | 43 45 44 55 52 45 20 41 |ain}.PRO|CEDURE A| |00002fc0| 6c 65 72 74 55 73 65 72 | 28 20 65 72 72 6f 72 20 |lertUser|( error | |00002fd0| 3a 20 49 4e 54 45 47 45 | 52 20 29 3b 0d 0d 7b 20 |: INTEGE|R );..{ | |00002fe0| 20 44 69 73 70 6c 61 79 | 20 61 6e 20 61 6c 65 72 | Display| an aler| |00002ff0| 74 20 74 68 61 74 20 74 | 65 6c 6c 73 20 74 68 65 |t that t|ells the| |00003000| 20 75 73 65 72 20 61 6e | 20 65 72 72 6f 72 20 6f | user an| error o| |00003010| 63 63 75 72 72 65 64 2c | 20 74 68 65 6e 20 65 78 |ccurred,| then ex| |00003020| 69 74 20 74 68 65 20 70 | 72 6f 67 72 61 6d 20 7d |it the p|rogram }| |00003030| 0d 20 0d 56 41 52 0d 09 | 69 74 65 6d 48 69 74 09 |. .VAR..|itemHit.| |00003040| 3a 20 49 4e 54 45 47 45 | 52 3b 0d 09 6d 65 73 73 |: INTEGE|R;..mess| |00003050| 61 67 65 09 3a 20 53 74 | 72 32 35 35 3b 0d 0d 42 |age.: St|r255;..B| |00003060| 45 47 49 4e 20 7b 20 41 | 6c 65 72 74 55 73 65 72 |EGIN { A|lertUser| |00003070| 20 7d 0d 09 53 65 74 43 | 75 72 73 6f 72 28 20 61 | }..SetC|ursor( a| |00003080| 72 72 6f 77 20 29 3b 0d | 09 47 65 74 49 6e 64 53 |rrow );.|.GetIndS| |00003090| 74 72 69 6e 67 28 20 6d | 65 73 73 61 67 65 2c 20 |tring( m|essage, | |000030a0| 6b 45 72 72 53 74 72 69 | 6e 67 73 2c 20 65 72 72 |kErrStri|ngs, err| |000030b0| 6f 72 20 29 3b 0d 09 50 | 61 72 61 6d 54 65 78 74 |or );..P|aramText| |000030c0| 28 6d 65 73 73 61 67 65 | 2c 20 27 27 2c 20 27 27 |(message|, '', ''| |000030d0| 2c 20 27 27 29 3b 0d 09 | 69 74 65 6d 48 69 74 20 |, '');..|itemHit | |000030e0| 3a 3d 20 41 6c 65 72 74 | 28 20 72 55 73 65 72 41 |:= Alert|( rUserA| |000030f0| 6c 65 72 74 2c 20 4e 49 | 4c 20 29 3b 0d 45 4e 44 |lert, NI|L );.END| |00003100| 3b 20 7b 20 41 6c 65 72 | 74 55 73 65 72 20 7d 0d |; { Aler|tUser }.| |00003110| 0d 0d 0d 7b 24 53 20 4d | 61 69 6e 7d 0d 50 52 4f |...{$S M|ain}.PRO| |00003120| 43 45 44 55 52 45 20 47 | 65 74 54 45 52 65 63 74 |CEDURE G|etTERect| |00003130| 28 20 77 69 6e 64 6f 77 | 20 3a 20 57 69 6e 64 6f |( window| : Windo| |00003140| 77 50 74 72 3b 20 56 41 | 52 20 74 65 52 65 63 74 |wPtr; VA|R teRect| |00003150| 20 3a 20 52 65 63 74 29 | 3b 0d 0d 7b 20 20 20 72 | : Rect)|;..{ r| |00003160| 65 74 75 72 6e 20 61 20 | 72 65 63 74 61 6e 67 6c |eturn a |rectangl| |00003170| 65 20 74 68 61 74 20 69 | 73 20 69 6e 73 65 74 20 |e that i|s inset | |00003180| 66 72 6f 6d 20 74 68 65 | 20 70 6f 72 74 52 65 63 |from the| portRec| |00003190| 74 20 62 79 20 74 68 65 | 20 73 69 7a 65 20 6f 66 |t by the| size of| |000031a0| 0d 09 74 68 65 20 73 63 | 72 6f 6c 6c 62 61 72 73 |..the sc|rollbars| |000031b0| 20 61 6e 64 20 61 20 6c | 69 74 74 6c 65 20 65 78 | and a l|ittle ex| |000031c0| 74 72 61 20 6d 61 72 67 | 69 6e 2e 20 7d 0d 0d 42 |tra marg|in. }..B| |000031d0| 45 47 49 4e 20 7b 20 47 | 65 74 54 45 52 65 63 74 |EGIN { G|etTERect| |000031e0| 20 7d 0d 09 74 65 52 65 | 63 74 20 3a 3d 20 77 69 | }..teRe|ct := wi| |000031f0| 6e 64 6f 77 5e 2e 70 6f | 72 74 52 65 63 74 3b 0d |ndow^.po|rtRect;.| |00003200| 09 49 6e 73 65 74 52 65 | 63 74 28 20 74 65 52 65 |.InsetRe|ct( teRe| |00003210| 63 74 2c 20 6b 54 65 78 | 74 4d 61 72 67 69 6e 2c |ct, kTex|tMargin,| |00003220| 20 6b 54 65 78 74 4d 61 | 72 67 69 6e 20 29 3b 09 | kTextMa|rgin );.| |00003230| 09 7b 20 61 64 6a 75 73 | 74 20 66 6f 72 20 6d 61 |.{ adjus|t for ma| |00003240| 72 67 69 6e 20 7d 0d 09 | 74 65 52 65 63 74 2e 62 |rgin }..|teRect.b| |00003250| 6f 74 74 6f 6d 20 3a 3d | 20 74 65 52 65 63 74 2e |ottom :=| teRect.| |00003260| 62 6f 74 74 6f 6d 20 2d | 20 6b 53 63 72 6f 6c 6c |bottom -| kScroll| |00003270| 62 61 72 41 64 6a 75 73 | 74 3b 09 7b 20 61 6e 64 |barAdjus|t;.{ and| |00003280| 20 66 6f 72 20 74 68 65 | 20 73 63 72 6f 6c 6c 62 | for the| scrollb| |00003290| 61 72 73 20 7d 0d 09 74 | 65 52 65 63 74 2e 72 69 |ars }..t|eRect.ri| |000032a0| 67 68 74 20 3a 3d 20 74 | 65 52 65 63 74 2e 72 69 |ght := t|eRect.ri| |000032b0| 67 68 74 20 2d 20 6b 53 | 63 72 6f 6c 6c 62 61 72 |ght - kS|crollbar| |000032c0| 41 64 6a 75 73 74 3b 0d | 45 4e 44 3b 20 7b 20 47 |Adjust;.|END; { G| |000032d0| 65 74 54 45 52 65 63 74 | 20 7d 0d 0d 0d 0d 7b 24 |etTERect| }....{$| |000032e0| 53 20 4d 61 69 6e 7d 0d | 46 55 4e 43 54 49 4f 4e |S Main}.|FUNCTION| |000032f0| 20 44 6f 43 6c 6f 73 65 | 57 69 6e 64 6f 77 28 20 | DoClose|Window( | |00003300| 77 69 6e 64 6f 77 20 3a | 20 57 69 6e 64 6f 77 50 |window :| WindowP| |00003310| 74 72 20 29 20 3a 20 42 | 4f 4f 4c 45 41 4e 3b 0d |tr ) : B|OOLEAN;.| |00003320| 0d 7b 09 43 6c 6f 73 65 | 20 61 20 77 69 6e 64 6f |.{.Close| a windo| |00003330| 77 2e 20 54 68 69 73 20 | 68 61 6e 64 6c 65 73 20 |w. This |handles | |00003340| 64 65 73 6b 20 61 63 63 | 65 73 73 6f 72 79 20 61 |desk acc|essory a| |00003350| 6e 64 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 77 |nd appli|cation w| |00003360| 69 6e 64 6f 77 73 2e 20 | 7d 0d 0d 42 45 47 49 4e |indows. |}..BEGIN| |00003370| 20 7b 20 44 6f 43 6c 6f | 73 65 57 69 6e 64 6f 77 | { DoClo|seWindow| |00003380| 20 7d 0d 09 44 6f 43 6c | 6f 73 65 57 69 6e 64 6f | }..DoCl|oseWindo| |00003390| 77 20 3a 3d 20 54 52 55 | 45 3b 0d 09 49 46 20 49 |w := TRU|E;..IF I| |000033a0| 73 44 41 57 69 6e 64 6f | 77 28 20 77 69 6e 64 6f |sDAWindo|w( windo| |000033b0| 77 20 29 20 54 48 45 4e | 0d 09 09 43 6c 6f 73 65 |w ) THEN|...Close| |000033c0| 44 65 73 6b 41 63 63 28 | 20 57 69 6e 64 6f 77 50 |DeskAcc(| WindowP| |000033d0| 65 65 6b 28 20 77 69 6e | 64 6f 77 20 29 5e 2e 77 |eek( win|dow )^.w| |000033e0| 69 6e 64 6f 77 4b 69 6e | 64 20 29 0d 09 45 4c 53 |indowKin|d )..ELS| |000033f0| 45 20 49 46 20 49 73 41 | 70 70 57 69 6e 64 6f 77 |E IF IsA|ppWindow| |00003400| 28 20 77 69 6e 64 6f 77 | 20 29 20 54 48 45 4e 20 |( window| ) THEN | |00003410| 42 45 47 49 4e 0d 09 09 | 57 49 54 48 20 44 6f 63 |BEGIN...|WITH Doc| |00003420| 75 6d 65 6e 74 50 65 65 | 6b 28 20 77 69 6e 64 6f |umentPee|k( windo| |00003430| 77 20 29 5e 20 44 4f 0d | 09 09 09 49 46 20 64 6f |w )^ DO.|...IF do| |00003440| 63 54 45 20 3c 3e 20 4e | 49 4c 20 54 48 45 4e 0d |cTE <> N|IL THEN.| |00003450| 09 09 09 09 54 45 44 69 | 73 70 6f 73 65 28 20 64 |....TEDi|spose( d| |00003460| 6f 63 54 45 20 29 3b 0d | 09 09 43 6c 6f 73 65 57 |ocTE );.|..CloseW| |00003470| 69 6e 64 6f 77 28 20 77 | 69 6e 64 6f 77 20 29 3b |indow( w|indow );| |00003480| 0d 09 09 44 69 73 70 6f | 73 50 74 72 28 20 50 74 |...Dispo|sPtr( Pt| |00003490| 72 28 20 77 69 6e 64 6f | 77 20 29 20 29 3b 0d 09 |r( windo|w ) );..| |000034a0| 09 67 4e 75 6d 44 6f 63 | 75 6d 65 6e 74 73 20 3a |.gNumDoc|uments :| |000034b0| 3d 20 67 4e 75 6d 44 6f | 63 75 6d 65 6e 74 73 20 |= gNumDo|cuments | |000034c0| 2d 20 31 3b 0d 09 45 4e | 44 3b 0d 45 4e 44 3b 20 |- 1;..EN|D;.END; | |000034d0| 7b 20 44 6f 43 6c 6f 73 | 65 57 69 6e 64 6f 77 20 |{ DoClos|eWindow | |000034e0| 7d 0d 0d 0d 0d 7b 24 53 | 20 4d 61 69 6e 7d 0d 50 |}....{$S| Main}.P| |000034f0| 52 4f 43 45 44 55 52 45 | 20 41 64 6a 75 73 74 54 |ROCEDURE| AdjustT| |00003500| 45 28 20 77 69 6e 64 6f | 77 20 3a 20 57 69 6e 64 |E( windo|w : Wind| |00003510| 6f 77 50 74 72 20 29 3b | 0d 0d 7b 09 53 63 72 6f |owPtr );|..{.Scro| |00003520| 6c 6c 20 74 68 65 20 54 | 45 52 65 63 20 61 72 6f |ll the T|ERec aro| |00003530| 75 6e 64 20 74 6f 20 6d | 61 74 63 68 20 75 70 20 |und to m|atch up | |00003540| 74 6f 20 74 68 65 20 70 | 6f 74 65 6e 74 69 61 6c |to the p|otential| |00003550| 6c 79 20 75 70 64 61 74 | 65 64 20 73 63 72 6f 6c |ly updat|ed scrol| |00003560| 6c 62 61 72 0d 09 76 61 | 6c 75 65 73 2e 20 54 68 |lbar..va|lues. Th| |00003570| 69 73 20 69 73 20 72 65 | 61 6c 6c 79 20 75 73 65 |is is re|ally use| |00003580| 66 75 6c 20 77 68 65 6e | 20 74 68 65 20 77 69 6e |ful when| the win| |00003590| 64 6f 77 20 72 65 73 69 | 7a 65 73 20 73 75 63 68 |dow resi|zes such| |000035a0| 20 74 68 61 74 20 74 68 | 65 0d 09 73 63 72 6f 6c | that th|e..scrol| |000035b0| 6c 62 61 72 73 20 62 65 | 63 6f 6d 65 20 69 6e 61 |lbars be|come ina| |000035c0| 63 74 69 76 65 20 61 6e | 64 20 74 68 65 20 54 45 |ctive an|d the TE| |000035d0| 52 65 63 20 68 61 64 20 | 62 65 65 6e 20 70 72 65 |Rec had |been pre| |000035e0| 76 69 6f 75 73 6c 79 20 | 73 63 72 6f 6c 6c 65 64 |viously |scrolled| |000035f0| 2e 20 7d 0d 0d 56 41 52 | 0d 09 76 61 6c 75 65 09 |. }..VAR|..value.| |00003600| 3a 20 49 4e 54 45 47 45 | 52 3b 0d 09 0d 42 45 47 |: INTEGE|R;...BEG| |00003610| 49 4e 20 7b 20 41 64 6a | 75 73 74 54 45 20 7d 0d |IN { Adj|ustTE }.| |00003620| 09 57 49 54 48 20 44 6f | 63 75 6d 65 6e 74 50 65 |.WITH Do|cumentPe| |00003630| 65 6b 28 20 77 69 6e 64 | 6f 77 20 29 5e 20 44 4f |ek( wind|ow )^ DO| |00003640| 20 42 45 47 49 4e 0d 09 | 09 54 45 53 63 72 6f 6c | BEGIN..|.TEScrol| |00003650| 6c 28 20 28 20 64 6f 63 | 54 45 5e 5e 2e 76 69 65 |l( ( doc|TE^^.vie| |00003660| 77 52 65 63 74 2e 6c 65 | 66 74 20 2d 20 64 6f 63 |wRect.le|ft - doc| |00003670| 54 45 5e 5e 2e 64 65 73 | 74 52 65 63 74 2e 6c 65 |TE^^.des|tRect.le| |00003680| 66 74 20 29 20 2d 20 47 | 65 74 43 74 6c 56 61 6c |ft ) - G|etCtlVal| |00003690| 75 65 28 20 64 6f 63 48 | 53 63 72 6f 6c 6c 20 29 |ue( docH|Scroll )| |000036a0| 2c 0d 09 09 09 09 28 20 | 64 6f 63 54 45 5e 5e 2e |,.....( |docTE^^.| |000036b0| 76 69 65 77 52 65 63 74 | 2e 74 6f 70 20 2d 20 64 |viewRect|.top - d| |000036c0| 6f 63 54 45 5e 5e 2e 64 | 65 73 74 52 65 63 74 2e |ocTE^^.d|estRect.| |000036d0| 74 6f 70 20 29 20 2d 0d | 09 09 09 09 47 65 74 43 |top ) -.|....GetC| |000036e0| 74 6c 56 61 6c 75 65 28 | 20 64 6f 63 56 53 63 72 |tlValue(| docVScr| |000036f0| 6f 6c 6c 20 29 20 2c 20 | 64 6f 63 54 45 20 29 3b |oll ) , |docTE );| |00003700| 0d 09 45 4e 44 3b 20 7b | 20 77 69 74 68 20 7d 0d |..END; {| with }.| |00003710| 45 4e 44 3b 20 7b 20 41 | 64 6a 75 73 74 54 45 20 |END; { A|djustTE | |00003720| 7d 0d 0d 0d 0d 7b 24 53 | 20 4d 61 69 6e 7d 0d 50 |}....{$S| Main}.P| |00003730| 52 4f 43 45 44 55 52 45 | 20 41 64 6a 75 73 74 48 |ROCEDURE| AdjustH| |00003740| 56 28 20 69 73 56 65 72 | 74 20 3a 20 42 4f 4f 4c |V( isVer|t : BOOL| |00003750| 45 41 4e 3b 20 63 6f 6e | 74 72 6f 6c 20 3a 20 43 |EAN; con|trol : C| |00003760| 6f 6e 74 72 6f 6c 48 61 | 6e 64 6c 65 3b 20 0d 09 |ontrolHa|ndle; ..| |00003770| 09 09 09 09 64 6f 63 54 | 45 20 3a 20 54 45 48 61 |....docT|E : TEHa| |00003780| 6e 64 6c 65 3b 20 63 61 | 6e 52 65 64 72 61 77 20 |ndle; ca|nRedraw | |00003790| 3a 20 42 4f 4f 4c 45 41 | 4e 20 29 3b 0d 09 09 09 |: BOOLEA|N );....| |000037a0| 09 09 0d 7b 43 61 6c 63 | 75 6c 61 74 65 20 74 68 |...{Calc|ulate th| |000037b0| 65 20 6e 65 77 20 63 6f | 6e 74 72 6f 6c 20 6d 61 |e new co|ntrol ma| |000037c0| 78 69 6d 75 6d 20 76 61 | 6c 75 65 20 61 6e 64 20 |ximum va|lue and | |000037d0| 63 75 72 72 65 6e 74 20 | 76 61 6c 75 65 2c 20 77 |current |value, w| |000037e0| 68 65 74 68 65 72 20 69 | 74 20 69 73 20 74 68 65 |hether i|t is the| |000037f0| 20 68 6f 72 69 7a 6f 6e | 74 61 6c 20 6f 72 0d 76 | horizon|tal or.v| |00003800| 65 72 74 69 63 61 6c 20 | 73 63 72 6f 6c 6c 62 61 |ertical |scrollba| |00003810| 72 2e 20 54 68 65 20 76 | 65 72 74 69 63 61 6c 20 |r. The v|ertical | |00003820| 6d 61 78 20 69 73 20 63 | 61 6c 63 75 6c 61 74 65 |max is c|alculate| |00003830| 64 20 62 79 20 63 6f 6d | 70 61 72 69 6e 67 20 74 |d by com|paring t| |00003840| 68 65 20 6e 75 6d 62 65 | 72 20 6f 66 20 6c 69 6e |he numbe|r of lin| |00003850| 65 73 20 74 6f 20 74 68 | 65 0d 76 65 72 74 69 63 |es to th|e.vertic| |00003860| 61 6c 20 73 69 7a 65 20 | 6f 66 20 74 68 65 20 76 |al size |of the v| |00003870| 69 65 77 52 65 63 74 2e | 20 54 68 65 20 68 6f 72 |iewRect.| The hor| |00003880| 69 7a 6f 6e 74 61 6c 20 | 6d 61 78 20 69 73 20 63 |izontal |max is c| |00003890| 61 6c 63 75 6c 61 74 65 | 64 20 62 79 20 63 6f 6d |alculate|d by com| |000038a0| 70 61 72 69 6e 67 20 74 | 68 65 20 6d 61 78 69 6d |paring t|he maxim| |000038b0| 75 6d 20 64 6f 63 75 6d | 65 6e 74 0d 77 69 64 74 |um docum|ent.widt| |000038c0| 68 20 74 6f 20 74 68 65 | 20 77 69 64 74 68 20 6f |h to the| width o| |000038d0| 66 20 74 68 65 20 76 69 | 65 77 52 65 63 74 2e 20 |f the vi|ewRect. | |000038e0| 54 68 65 20 63 75 72 72 | 65 6e 74 20 76 61 6c 75 |The curr|ent valu| |000038f0| 65 73 20 61 72 65 20 73 | 65 74 20 62 79 20 63 6f |es are s|et by co| |00003900| 6d 70 61 72 69 6e 67 20 | 74 68 65 20 6f 66 66 73 |mparing |the offs| |00003910| 65 74 20 62 65 74 77 65 | 65 6e 0d 74 68 65 20 76 |et betwe|en.the v| |00003920| 69 65 77 20 61 6e 64 20 | 64 65 73 74 69 6e 61 74 |iew and |destinat| |00003930| 69 6f 6e 20 72 65 63 74 | 73 2e 20 49 66 20 6e 65 |ion rect|s. If ne| |00003940| 63 65 73 73 61 72 79 20 | 61 6e 64 20 77 65 20 63 |cessary |and we c| |00003950| 61 6e 52 65 64 72 61 77 | 2c 20 68 61 76 65 20 74 |anRedraw|, have t| |00003960| 68 65 20 63 6f 6e 74 72 | 6f 6c 20 62 65 20 72 65 |he contr|ol be re| |00003970| 2d 64 72 61 77 6e 20 62 | 79 0d 63 61 6c 6c 69 6e |-drawn b|y.callin| |00003980| 67 20 53 68 6f 77 43 6f | 6e 74 72 6f 6c 2e 7d 0d |g ShowCo|ntrol.}.| |00003990| 0d 7b 54 45 53 74 79 6c | 65 53 61 6d 70 6c 65 2d |.{TEStyl|eSample-| |000039a0| 76 65 72 74 69 63 61 6c | 20 6d 61 78 20 6f 72 69 |vertical| max ori| |000039b0| 67 69 6e 61 6c 6c 79 20 | 75 73 65 64 20 6c 69 6e |ginally |used lin| |000039c0| 65 20 62 79 20 6c 69 6e | 65 20 63 61 6c 63 75 6c |e by lin|e calcul| |000039d0| 61 74 69 6f 6e 73 2d 6c | 69 6e 65 68 65 69 67 68 |ations-l|ineheigh| |000039e0| 74 20 77 61 73 20 61 0d | 63 6f 6e 73 74 61 6e 74 |t was a.|constant| |000039f0| 20 76 61 6c 75 65 20 73 | 6f 20 69 74 20 77 61 73 | value s|o it was| |00003a00| 20 65 61 73 79 20 74 6f | 20 66 69 67 75 72 65 20 | easy to| figure | |00003a10| 6f 75 74 20 77 68 61 74 | 20 74 68 65 20 72 61 6e |out what| the ran| |00003a20| 67 65 20 73 68 6f 75 6c | 64 20 62 65 20 61 6e 64 |ge shoul|d be and| |00003a30| 20 70 69 6e 20 74 68 65 | 20 76 61 6c 75 65 0d 77 | pin the| value.w| |00003a40| 69 74 68 69 6e 20 72 61 | 6e 67 65 2e 20 4e 6f 77 |ithin ra|nge. Now| |00003a50| 20 77 65 20 6e 65 65 64 | 20 74 6f 20 75 73 65 20 | we need| to use | |00003a60| 6d 61 78 20 61 6e 64 20 | 6d 69 6e 20 76 61 6c 75 |max and |min valu| |00003a70| 65 73 20 69 6e 20 70 69 | 78 65 6c 73 20 72 61 74 |es in pi|xels rat| |00003a80| 68 65 72 20 74 68 61 6e | 20 69 6e 20 6e 6c 69 6e |her than| in nlin| |00003a90| 65 73 7d 0d 0d 56 41 52 | 0d 09 76 61 6c 75 65 2c |es}..VAR|..value,| |00003aa0| 20 6d 61 78 20 09 09 09 | 3a 20 49 4e 54 45 47 45 | max ...|: INTEGE| |00003ab0| 52 3b 0d 09 6f 6c 64 56 | 61 6c 75 65 2c 20 6f 6c |R;..oldV|alue, ol| |00003ac0| 64 4d 61 78 09 3a 20 49 | 4e 54 45 47 45 52 3b 0d |dMax.: I|NTEGER;.| |00003ad0| 09 0d 42 45 47 49 4e 20 | 7b 20 41 64 6a 75 73 74 |..BEGIN |{ Adjust| |00003ae0| 48 56 20 7d 0d 09 6f 6c | 64 56 61 6c 75 65 20 3a |HV }..ol|dValue :| |00003af0| 3d 20 47 65 74 43 74 6c | 56 61 6c 75 65 28 20 63 |= GetCtl|Value( c| |00003b00| 6f 6e 74 72 6f 6c 20 29 | 3b 0d 09 6f 6c 64 4d 61 |ontrol )|;..oldMa| |00003b10| 78 20 3a 3d 20 47 65 74 | 43 74 6c 4d 61 78 28 20 |x := Get|CtlMax( | |00003b20| 63 6f 6e 74 72 6f 6c 20 | 29 3b 0d 09 49 46 20 69 |control |);..IF i| |00003b30| 73 56 65 72 74 20 54 48 | 45 4e 20 42 45 47 49 4e |sVert TH|EN BEGIN| |00003b40| 0d 09 09 7b 20 6e 65 77 | 20 66 6f 72 20 54 45 53 |...{ new| for TES| |00003b50| 74 79 6c 65 53 61 6d 70 | 6c 65 20 7d 0d 09 09 6d |tyleSamp|le }...m| |00003b60| 61 78 20 3a 3d 20 28 20 | 54 45 47 65 74 48 65 69 |ax := ( |TEGetHei| |00003b70| 67 68 74 28 20 64 6f 63 | 54 45 5e 5e 2e 6e 4c 69 |ght( doc|TE^^.nLi| |00003b80| 6e 65 73 2c 20 30 2c 20 | 64 6f 63 54 45 20 29 20 |nes, 0, |docTE ) | |00003b90| 29 20 2d 20 0d 09 09 09 | 09 09 09 09 28 20 64 6f |) - ....|....( do| |00003ba0| 63 54 45 5e 5e 2e 76 69 | 65 77 52 65 63 74 2e 62 |cTE^^.vi|ewRect.b| |00003bb0| 6f 74 74 6f 6d 20 2d 20 | 64 6f 63 54 45 5e 5e 2e |ottom - |docTE^^.| |00003bc0| 76 69 65 77 52 65 63 74 | 2e 74 6f 70 20 29 3b 0d |viewRect|.top );.| |00003bd0| 09 09 0d 09 45 4e 44 20 | 45 4c 53 45 0d 09 09 6d |....END |ELSE...m| |00003be0| 61 78 20 3a 3d 20 6b 4d | 61 78 44 6f 63 57 69 64 |ax := kM|axDocWid| |00003bf0| 74 68 20 2d 20 28 64 6f | 63 54 45 5e 5e 2e 76 69 |th - (do|cTE^^.vi| |00003c00| 65 77 52 65 63 74 2e 72 | 69 67 68 74 20 2d 20 64 |ewRect.r|ight - d| |00003c10| 6f 63 54 45 5e 5e 2e 76 | 69 65 77 52 65 63 74 2e |ocTE^^.v|iewRect.| |00003c20| 6c 65 66 74 20 29 3b 0d | 09 0d 09 49 46 20 6d 61 |left );.|...IF ma| |00003c30| 78 20 3c 20 30 20 54 48 | 45 4e 0d 09 09 6d 61 78 |x < 0 TH|EN...max| |00003c40| 20 3a 3d 20 30 3b 09 09 | 09 7b 20 63 68 65 63 6b | := 0;..|.{ check| |00003c50| 20 66 6f 72 20 6e 65 67 | 61 74 69 76 65 20 76 61 | for neg|ative va| |00003c60| 6c 75 65 73 20 7d 0d 09 | 53 65 74 43 74 6c 4d 61 |lues }..|SetCtlMa| |00003c70| 78 28 20 63 6f 6e 74 72 | 6f 6c 2c 20 6d 61 78 20 |x( contr|ol, max | |00003c80| 29 3b 0d 09 49 46 20 69 | 73 56 65 72 74 20 54 48 |);..IF i|sVert TH| |00003c90| 45 4e 0d 09 09 76 61 6c | 75 65 20 3a 3d 20 64 6f |EN...val|ue := do| |00003ca0| 63 54 45 5e 5e 2e 76 69 | 65 77 52 65 63 74 2e 74 |cTE^^.vi|ewRect.t| |00003cb0| 6f 70 20 2d 20 64 6f 63 | 54 45 5e 5e 2e 64 65 73 |op - doc|TE^^.des| |00003cc0| 74 52 65 63 74 2e 74 6f | 70 20 0d 09 45 4c 53 45 |tRect.to|p ..ELSE| |00003cd0| 0d 09 09 76 61 6c 75 65 | 20 3a 3d 20 64 6f 63 54 |...value| := docT| |00003ce0| 45 5e 5e 2e 76 69 65 77 | 52 65 63 74 2e 6c 65 66 |E^^.view|Rect.lef| |00003cf0| 74 20 2d 20 64 6f 63 54 | 45 5e 5e 2e 64 65 73 74 |t - docT|E^^.dest| |00003d00| 52 65 63 74 2e 6c 65 66 | 74 3b 0d 09 49 46 20 76 |Rect.lef|t;..IF v| |00003d10| 61 6c 75 65 20 3c 20 30 | 20 54 48 45 4e 0d 09 09 |alue < 0| THEN...| |00003d20| 76 61 6c 75 65 20 3a 3d | 20 30 0d 09 45 4c 53 45 |value :=| 0..ELSE| |00003d30| 20 49 46 20 76 61 6c 75 | 65 20 3e 20 6d 61 78 20 | IF valu|e > max | |00003d40| 54 48 45 4e 0d 09 09 76 | 61 6c 75 65 20 3a 3d 20 |THEN...v|alue := | |00003d50| 6d 61 78 3b 09 09 7b 20 | 70 69 6e 20 74 68 65 20 |max;..{ |pin the | |00003d60| 76 61 6c 75 65 20 74 6f | 20 77 69 74 68 69 6e 20 |value to| within | |00003d70| 72 61 6e 67 65 20 7d 0d | 09 53 65 74 43 74 6c 56 |range }.|.SetCtlV| |00003d80| 61 6c 75 65 28 20 63 6f | 6e 74 72 6f 6c 2c 20 76 |alue( co|ntrol, v| |00003d90| 61 6c 75 65 20 29 3b 0d | 09 49 46 20 63 61 6e 52 |alue );.|.IF canR| |00003da0| 65 64 72 61 77 20 26 20 | 28 20 28 20 6d 61 78 20 |edraw & |( ( max | |00003db0| 3c 3e 20 6f 6c 64 4d 61 | 78 20 29 20 7c 20 28 20 |<> oldMa|x ) | ( | |00003dc0| 76 61 6c 75 65 20 3c 3e | 20 6f 6c 64 56 61 6c 75 |value <>| oldValu| |00003dd0| 65 20 29 20 29 20 54 48 | 45 4e 0d 09 09 53 68 6f |e ) ) TH|EN...Sho| |00003de0| 77 43 6f 6e 74 72 6f 6c | 28 20 63 6f 6e 74 72 6f |wControl|( contro| |00003df0| 6c 20 29 3b 09 09 09 7b | 20 63 68 65 63 6b 20 74 |l );...{| check t| |00003e00| 6f 20 73 65 65 20 69 66 | 20 74 68 65 20 63 6f 6e |o see if| the con| |00003e10| 74 72 6f 6c 20 63 61 6e | 20 62 65 20 72 65 2d 64 |trol can| be re-d| |00003e20| 72 61 77 6e 20 7d 0d 45 | 4e 44 3b 20 7b 20 41 64 |rawn }.E|ND; { Ad| |00003e30| 6a 75 73 74 48 56 20 7d | 0d 0d 0d 0d 7b 24 53 20 |justHV }|....{$S | |00003e40| 4d 61 69 6e 7d 0d 50 52 | 4f 43 45 44 55 52 45 20 |Main}.PR|OCEDURE | |00003e50| 41 64 6a 75 73 74 53 63 | 72 6f 6c 6c 56 61 6c 75 |AdjustSc|rollValu| |00003e60| 65 73 28 20 77 69 6e 64 | 6f 77 20 3a 20 57 69 6e |es( wind|ow : Win| |00003e70| 64 6f 77 50 74 72 3b 20 | 63 61 6e 52 65 64 72 61 |dowPtr; |canRedra| |00003e80| 77 20 3a 20 42 4f 4f 4c | 45 41 4e 20 29 3b 0d 0d |w : BOOL|EAN );..| |00003e90| 7b 09 53 69 6d 70 6c 79 | 20 63 61 6c 6c 20 74 68 |{.Simply| call th| |00003ea0| 65 20 63 6f 6d 6d 6f 6e | 20 61 64 6a 75 73 74 20 |e common| adjust | |00003eb0| 72 6f 75 74 69 6e 65 20 | 66 6f 72 20 74 68 65 20 |routine |for the | |00003ec0| 76 65 72 74 69 63 61 6c | 20 61 6e 64 20 68 6f 72 |vertical| and hor| |00003ed0| 69 7a 6f 6e 74 61 6c 20 | 73 63 72 6f 6c 6c 62 61 |izontal |scrollba| |00003ee0| 72 73 2e 20 7d 0d 0d 42 | 45 47 49 4e 20 7b 20 41 |rs. }..B|EGIN { A| |00003ef0| 64 6a 75 73 74 53 63 72 | 6f 6c 6c 56 61 6c 75 65 |djustScr|ollValue| |00003f00| 73 20 7d 0d 09 57 49 54 | 48 20 44 6f 63 75 6d 65 |s }..WIT|H Docume| |00003f10| 6e 74 50 65 65 6b 28 20 | 77 69 6e 64 6f 77 20 29 |ntPeek( |window )| |00003f20| 5e 20 44 4f 20 42 45 47 | 49 4e 0d 09 09 41 64 6a |^ DO BEG|IN...Adj| |00003f30| 75 73 74 48 56 28 20 54 | 52 55 45 2c 20 64 6f 63 |ustHV( T|RUE, doc| |00003f40| 56 53 63 72 6f 6c 6c 2c | 20 64 6f 63 54 45 2c 20 |VScroll,| docTE, | |00003f50| 63 61 6e 52 65 64 72 61 | 77 20 29 3b 0d 09 09 41 |canRedra|w );...A| |00003f60| 64 6a 75 73 74 48 56 28 | 20 46 41 4c 53 45 2c 20 |djustHV(| FALSE, | |00003f70| 64 6f 63 48 53 63 72 6f | 6c 6c 2c 20 64 6f 63 54 |docHScro|ll, docT| |00003f80| 45 2c 20 63 61 6e 52 65 | 64 72 61 77 20 29 3b 0d |E, canRe|draw );.| |00003f90| 09 45 4e 44 3b 20 7b 20 | 77 69 74 68 20 7d 0d 45 |.END; { |with }.E| |00003fa0| 4e 44 3b 20 7b 20 41 64 | 6a 75 73 74 53 63 72 6f |ND; { Ad|justScro| |00003fb0| 6c 6c 56 61 6c 75 65 73 | 20 7d 0d 0d 0d 0d 7b 24 |llValues| }....{$| |00003fc0| 53 20 4d 61 69 6e 7d 0d | 50 52 4f 43 45 44 55 52 |S Main}.|PROCEDUR| |00003fd0| 45 20 41 64 6a 75 73 74 | 53 63 72 6f 6c 6c 53 69 |E Adjust|ScrollSi| |00003fe0| 7a 65 73 28 20 77 69 6e | 64 6f 77 20 3a 20 57 69 |zes( win|dow : Wi| |00003ff0| 6e 64 6f 77 50 74 72 20 | 29 3b 0d 0d 7b 09 52 65 |ndowPtr |);..{.Re| |00004000| 2d 63 61 6c 63 75 6c 61 | 74 65 20 74 68 65 20 70 |-calcula|te the p| |00004010| 6f 73 69 74 69 6f 6e 20 | 61 6e 64 20 73 69 7a 65 |osition |and size| |00004020| 20 6f 66 20 74 68 65 20 | 76 69 65 77 52 65 63 74 | of the |viewRect| |00004030| 20 61 6e 64 20 74 68 65 | 20 73 63 72 6f 6c 6c 62 | and the| scrollb| |00004040| 61 72 73 2e 0d 20 09 6b | 53 63 72 6f 6c 6c 54 77 |ars.. .k|ScrollTw| |00004050| 65 65 6b 20 63 6f 6d 70 | 65 6e 73 61 74 65 73 20 |eek comp|ensates | |00004060| 66 6f 72 20 6f 66 66 2d | 62 79 2d 6f 6e 65 20 72 |for off-|by-one r| |00004070| 65 71 75 69 72 65 6d 65 | 6e 74 73 20 6f 66 20 74 |equireme|nts of t| |00004080| 68 65 20 73 63 72 6f 6c | 6c 62 61 72 73 0d 09 74 |he scrol|lbars..t| |00004090| 6f 20 68 61 76 65 20 62 | 6f 72 64 65 72 73 20 63 |o have b|orders c| |000040a0| 6f 69 6e 63 69 64 65 20 | 77 69 74 68 20 74 68 65 |oincide |with the| |000040b0| 20 67 72 6f 77 62 6f 78 | 2e 20 7d 0d 0d 56 41 52 | growbox|. }..VAR| |000040c0| 0d 09 74 65 52 65 63 74 | 09 3a 20 52 65 63 74 3b |..teRect|.: Rect;| |000040d0| 0d 0d 42 45 47 49 4e 20 | 7b 20 41 64 6a 75 73 74 |..BEGIN |{ Adjust| |000040e0| 53 63 72 6f 6c 6c 53 69 | 7a 65 73 20 7d 0d 09 47 |ScrollSi|zes }..G| |000040f0| 65 74 54 45 52 65 63 74 | 28 20 77 69 6e 64 6f 77 |etTERect|( window| |00004100| 2c 20 74 65 52 65 63 74 | 20 29 3b 20 7b 73 74 61 |, teRect| ); {sta| |00004110| 72 74 20 77 69 74 68 20 | 74 65 52 65 63 74 7d 0d |rt with |teRect}.| |00004120| 09 57 49 54 48 20 44 6f | 63 75 6d 65 6e 74 50 65 |.WITH Do|cumentPe| |00004130| 65 6b 28 20 77 69 6e 64 | 6f 77 20 29 5e 2c 20 77 |ek( wind|ow )^, w| |00004140| 69 6e 64 6f 77 5e 2e 70 | 6f 72 74 52 65 63 74 20 |indow^.p|ortRect | |00004150| 44 4f 20 42 45 47 49 4e | 0d 09 09 64 6f 63 54 45 |DO BEGIN|...docTE| |00004160| 5e 5e 2e 76 69 65 77 52 | 65 63 74 20 3a 3d 20 74 |^^.viewR|ect := t| |00004170| 65 52 65 63 74 3b 0d 09 | 09 0d 09 09 7b 20 41 64 |eRect;..|....{ Ad| |00004180| 6a 75 73 74 56 69 65 77 | 52 65 63 74 28 64 6f 63 |justView|Rect(doc| |00004190| 54 45 29 20 77 61 73 20 | 72 65 6d 6f 76 65 64 2d |TE) was |removed-| |000041a0| 2d 6e 6f 20 6c 6f 6e 67 | 65 72 20 6e 65 65 64 65 |-no long|er neede| |000041b0| 64 20 7d 0d 09 09 0d 09 | 09 4d 6f 76 65 43 6f 6e |d }.....|.MoveCon| |000041c0| 74 72 6f 6c 28 20 64 6f | 63 56 53 63 72 6f 6c 6c |trol( do|cVScroll| |000041d0| 2c 20 72 69 67 68 74 20 | 2d 20 6b 53 63 72 6f 6c |, right |- kScrol| |000041e0| 6c 62 61 72 41 64 6a 75 | 73 74 2c 20 2d 31 20 29 |lbarAdju|st, -1 )| |000041f0| 3b 0d 09 09 53 69 7a 65 | 43 6f 6e 74 72 6f 6c 28 |;...Size|Control(| |00004200| 20 64 6f 63 56 53 63 72 | 6f 6c 6c 2c 20 6b 53 63 | docVScr|oll, kSc| |00004210| 72 6f 6c 6c 62 61 72 57 | 69 64 74 68 2c 20 28 20 |rollbarW|idth, ( | |00004220| 62 6f 74 74 6f 6d 20 2d | 20 74 6f 70 20 29 20 2d |bottom -| top ) -| |00004230| 0d 09 09 09 09 09 09 28 | 20 6b 53 63 72 6f 6c 6c |.......(| kScroll| |00004240| 62 61 72 41 64 6a 75 73 | 74 20 2d 20 6b 53 63 72 |barAdjus|t - kScr| |00004250| 6f 6c 6c 54 77 65 65 6b | 20 29 20 29 3b 0d 09 09 |ollTweek| ) );...| |00004260| 4d 6f 76 65 43 6f 6e 74 | 72 6f 6c 28 20 64 6f 63 |MoveCont|rol( doc| |00004270| 48 53 63 72 6f 6c 6c 2c | 20 2d 31 2c 20 62 6f 74 |HScroll,| -1, bot| |00004280| 74 6f 6d 20 2d 20 6b 53 | 63 72 6f 6c 6c 62 61 72 |tom - kS|crollbar| |00004290| 41 64 6a 75 73 74 20 29 | 3b 0d 09 09 53 69 7a 65 |Adjust )|;...Size| |000042a0| 43 6f 6e 74 72 6f 6c 28 | 20 64 6f 63 48 53 63 72 |Control(| docHScr| |000042b0| 6f 6c 6c 2c 20 28 20 72 | 69 67 68 74 20 2d 20 6c |oll, ( r|ight - l| |000042c0| 65 66 74 20 29 20 2d 20 | 28 20 6b 53 63 72 6f 6c |eft ) - |( kScrol| |000042d0| 6c 62 61 72 41 64 6a 75 | 73 74 20 2d 0d 09 09 09 |lbarAdju|st -....| |000042e0| 09 09 09 6b 53 63 72 6f | 6c 6c 54 77 65 65 6b 20 |...kScro|llTweek | |000042f0| 29 2c 20 6b 53 63 72 6f | 6c 6c 62 61 72 57 69 64 |), kScro|llbarWid| |00004300| 74 68 20 29 3b 0d 09 45 | 4e 44 3b 20 7b 20 77 69 |th );..E|ND; { wi| |00004310| 74 68 20 7d 0d 45 4e 44 | 3b 20 7b 20 41 64 6a 75 |th }.END|; { Adju| |00004320| 73 74 53 63 72 6f 6c 6c | 53 69 7a 65 73 20 7d 0d |stScroll|Sizes }.| |00004330| 0d 0d 0d 7b 24 53 20 4d | 61 69 6e 7d 0d 50 52 4f |...{$S M|ain}.PRO| |00004340| 43 45 44 55 52 45 20 41 | 64 6a 75 73 74 53 63 72 |CEDURE A|djustScr| |00004350| 6f 6c 6c 62 61 72 73 28 | 20 77 69 6e 64 6f 77 20 |ollbars(| window | |00004360| 3a 20 57 69 6e 64 6f 77 | 50 74 72 3b 20 6e 65 65 |: Window|Ptr; nee| |00004370| 64 73 52 65 73 69 7a 65 | 20 3a 20 42 4f 4f 4c 45 |dsResize| : BOOLE| |00004380| 41 4e 20 29 3b 0d 0d 7b | 09 54 75 72 6e 20 6f 66 |AN );..{|.Turn of| |00004390| 66 20 74 68 65 20 63 6f | 6e 74 72 6f 6c 73 20 62 |f the co|ntrols b| |000043a0| 79 20 6a 61 6d 6d 69 6e | 67 20 61 20 7a 65 72 6f |y jammin|g a zero| |000043b0| 20 69 6e 74 6f 20 74 68 | 65 69 72 20 63 6f 6e 74 | into th|eir cont| |000043c0| 72 6c 56 69 73 20 66 69 | 65 6c 64 73 20 0d 09 28 |rlVis fi|elds ..(| |000043d0| 48 69 64 65 43 6f 6e 74 | 72 6f 6c 20 65 72 61 73 |HideCont|rol eras| |000043e0| 65 73 20 74 68 65 6d 20 | 61 6e 64 20 77 65 20 64 |es them |and we d| |000043f0| 6f 6e 27 74 20 77 61 6e | 74 20 74 68 61 74 29 2e |on't wan|t that).| |00004400| 20 49 66 20 74 68 65 20 | 63 6f 6e 74 72 6f 6c 73 | If the |controls| |00004410| 20 61 72 65 20 74 6f 20 | 0d 09 62 65 20 72 65 73 | are to |..be res| |00004420| 69 7a 65 64 20 61 73 20 | 77 65 6c 6c 2c 20 63 61 |ized as |well, ca| |00004430| 6c 6c 20 74 68 65 20 70 | 72 6f 63 65 64 75 72 65 |ll the p|rocedure| |00004440| 20 74 6f 20 64 6f 20 74 | 68 61 74 2c 20 74 68 65 | to do t|hat, the| |00004450| 6e 20 63 61 6c 6c 20 74 | 68 65 20 70 72 6f 63 65 |n call t|he proce| |00004460| 64 75 72 65 20 0d 09 74 | 6f 20 61 64 6a 75 73 74 |dure ..t|o adjust| |00004470| 20 74 68 65 20 6d 61 78 | 69 6d 75 6d 20 61 6e 64 | the max|imum and| |00004480| 20 63 75 72 72 65 6e 74 | 20 76 61 6c 75 65 73 2e | current| values.| |00004490| 20 46 69 6e 61 6c 6c 79 | 20 72 65 2d 65 6e 61 62 | Finally| re-enab| |000044a0| 6c 65 20 74 68 65 20 63 | 6f 6e 74 72 6f 6c 73 0d |le the c|ontrols.| |000044b0| 09 62 79 20 6a 61 6d 6d | 69 6e 67 20 61 20 24 46 |.by jamm|ing a $F| |000044c0| 46 20 69 6e 20 74 68 65 | 69 72 20 63 6f 6e 74 72 |F in the|ir contr| |000044d0| 6c 56 69 73 20 66 69 65 | 6c 64 73 2e 20 7d 0d 0d |lVis fie|lds. }..| |000044e0| 56 41 52 0d 09 6f 6c 64 | 4d 61 78 2c 20 6f 6c 64 |VAR..old|Max, old| |000044f0| 56 61 6c 09 3a 20 49 4e | 54 45 47 45 52 3b 0d 0d |Val.: IN|TEGER;..| |00004500| 42 45 47 49 4e 20 7b 20 | 41 64 6a 75 73 74 53 63 |BEGIN { |AdjustSc| |00004510| 72 6f 6c 6c 62 61 72 73 | 20 7d 0d 09 57 49 54 48 |rollbars| }..WITH| |00004520| 20 44 6f 63 75 6d 65 6e | 74 50 65 65 6b 28 20 77 | Documen|tPeek( w| |00004530| 69 6e 64 6f 77 20 29 5e | 20 44 4f 20 42 45 47 49 |indow )^| DO BEGI| |00004540| 4e 0d 09 09 64 6f 63 56 | 53 63 72 6f 6c 6c 5e 5e |N...docV|Scroll^^| |00004550| 2e 63 6f 6e 74 72 6c 56 | 69 73 20 3a 3d 20 6b 43 |.contrlV|is := kC| |00004560| 6f 6e 74 72 6f 6c 49 6e | 76 69 73 69 62 6c 65 3b |ontrolIn|visible;| |00004570| 20 7b 20 74 75 72 6e 20 | 74 68 65 6d 20 6f 66 66 | { turn |them off| |00004580| 20 7d 0d 09 09 64 6f 63 | 48 53 63 72 6f 6c 6c 5e | }...doc|HScroll^| |00004590| 5e 2e 63 6f 6e 74 72 6c | 56 69 73 20 3a 3d 20 6b |^.contrl|Vis := k| |000045a0| 43 6f 6e 74 72 6f 6c 49 | 6e 76 69 73 69 62 6c 65 |ControlI|nvisible| |000045b0| 3b 0d 09 09 49 46 20 6e | 65 65 64 73 52 65 73 69 |;...IF n|eedsResi| |000045c0| 7a 65 20 54 48 45 4e 09 | 09 09 09 09 09 09 7b 20 |ze THEN.|......{ | |000045d0| 6d 6f 76 65 20 61 6e 64 | 20 73 69 7a 65 20 69 66 |move and| size if| |000045e0| 20 6e 65 65 64 65 64 20 | 7d 0d 09 09 09 41 64 6a | needed |}....Adj| |000045f0| 75 73 74 53 63 72 6f 6c | 6c 53 69 7a 65 73 28 20 |ustScrol|lSizes( | |00004600| 77 69 6e 64 6f 77 20 29 | 3b 0d 09 09 41 64 6a 75 |window )|;...Adju| |00004610| 73 74 53 63 72 6f 6c 6c | 56 61 6c 75 65 73 28 20 |stScroll|Values( | |00004620| 77 69 6e 64 6f 77 2c 20 | 4e 4f 54 20 6e 65 65 64 |window, |NOT need| |00004630| 73 52 65 73 69 7a 65 20 | 29 3b 20 7b 20 66 6f 6f |sResize |); { foo| |00004640| 6c 20 77 69 74 68 20 6d | 61 78 20 61 6e 64 20 63 |l with m|ax and c| |00004650| 75 72 72 65 6e 74 20 76 | 61 6c 75 65 20 7d 0d 09 |urrent v|alue }..| |00004660| 09 7b 20 4e 6f 77 2c 20 | 72 65 73 74 6f 72 65 20 |.{ Now, |restore | |00004670| 76 69 73 69 62 69 6c 69 | 74 79 20 69 6e 20 63 61 |visibili|ty in ca| |00004680| 73 65 20 77 65 20 6e 65 | 76 65 72 20 68 61 64 20 |se we ne|ver had | |00004690| 74 6f 20 53 68 6f 77 43 | 6f 6e 74 72 6f 6c 20 64 |to ShowC|ontrol d| |000046a0| 75 72 69 6e 67 20 61 64 | 6a 75 73 74 6d 65 6e 74 |uring ad|justment| |000046b0| 20 7d 0d 09 09 64 6f 63 | 56 53 63 72 6f 6c 6c 5e | }...doc|VScroll^| |000046c0| 5e 2e 63 6f 6e 74 72 6c | 56 69 73 20 3a 3d 20 6b |^.contrl|Vis := k| |000046d0| 43 6f 6e 74 72 6f 6c 56 | 69 73 69 62 6c 65 3b 20 |ControlV|isible; | |000046e0| 7b 20 74 75 72 6e 20 74 | 68 65 6d 20 6f 6e 20 7d |{ turn t|hem on }| |000046f0| 0d 09 09 64 6f 63 48 53 | 63 72 6f 6c 6c 5e 5e 2e |...docHS|croll^^.| |00004700| 63 6f 6e 74 72 6c 56 69 | 73 20 3a 3d 20 6b 43 6f |contrlVi|s := kCo| |00004710| 6e 74 72 6f 6c 56 69 73 | 69 62 6c 65 3b 0d 09 45 |ntrolVis|ible;..E| |00004720| 4e 44 3b 0d 45 4e 44 3b | 20 7b 20 41 64 6a 75 73 |ND;.END;| { Adjus| |00004730| 74 53 63 72 6f 6c 6c 62 | 61 72 73 20 7d 0d 0d 0d |tScrollb|ars }...| |00004740| 0d 7b 24 53 20 4d 61 69 | 6e 7d 0d 7b 24 50 55 53 |.{$S Mai|n}.{$PUS| |00004750| 48 7d 20 7b 24 5a 2b 7d | 0d 50 52 4f 43 45 44 55 |H} {$Z+}|.PROCEDU| |00004760| 52 45 20 50 61 73 63 61 | 6c 43 6c 69 6b 4c 6f 6f |RE Pasca|lClikLoo| |00004770| 70 3b 0d 0d 7b 09 47 65 | 74 73 20 63 61 6c 6c 65 |p;..{.Ge|ts calle| |00004780| 64 20 66 72 6f 6d 20 6f | 75 72 20 61 73 73 65 6d |d from o|ur assem| |00004790| 62 6c 79 20 6c 61 6e 67 | 75 61 67 65 20 72 6f 75 |bly lang|uage rou| |000047a0| 74 69 6e 65 2c 20 41 73 | 6d 43 6c 69 6b 4c 6f 6f |tine, As|mClikLoo| |000047b0| 70 2c 20 77 68 69 63 68 | 20 69 73 20 69 6e 0d 20 |p, which| is in. | |000047c0| 09 74 75 72 6e 20 63 61 | 6c 6c 65 64 20 62 79 20 |.turn ca|lled by | |000047d0| 74 68 65 20 54 45 43 6c | 69 63 6b 20 74 6f 6f 6c |the TECl|ick tool| |000047e0| 62 6f 78 20 72 6f 75 74 | 69 6e 65 2e 20 53 61 76 |box rout|ine. Sav| |000047f0| 65 73 20 74 68 65 20 77 | 69 6e 64 6f 77 73 20 63 |es the w|indows c| |00004800| 6c 69 70 20 72 65 67 69 | 6f 6e 2c 0d 20 09 73 65 |lip regi|on,. .se| |00004810| 74 73 20 69 74 20 74 6f | 20 74 68 65 20 70 6f 72 |ts it to| the por| |00004820| 74 52 65 63 74 2c 20 61 | 64 6a 75 73 74 73 20 74 |tRect, a|djusts t| |00004830| 68 65 20 73 63 72 6f 6c | 6c 62 61 72 20 76 61 6c |he scrol|lbar val| |00004840| 75 65 73 20 74 6f 20 6d | 61 74 63 68 20 74 68 65 |ues to m|atch the| |00004850| 20 54 45 20 73 63 72 6f | 6c 6c 0d 09 20 61 6d 6f | TE scro|ll.. amo| |00004860| 75 6e 74 2c 20 74 68 65 | 6e 20 72 65 73 74 6f 72 |unt, the|n restor| |00004870| 65 73 20 74 68 65 20 63 | 6c 69 70 20 72 65 67 69 |es the c|lip regi| |00004880| 6f 6e 2e 20 7d 0d 0d 56 | 41 52 0d 09 77 69 6e 64 |on. }..V|AR..wind| |00004890| 6f 77 20 3a 20 57 69 6e | 64 6f 77 50 74 72 3b 0d |ow : Win|dowPtr;.| |000048a0| 09 72 65 67 69 6f 6e 20 | 3a 20 52 67 6e 48 61 6e |.region |: RgnHan| |000048b0| 64 6c 65 3b 0d 0d 42 45 | 47 49 4e 20 7b 20 50 61 |dle;..BE|GIN { Pa| |000048c0| 73 63 61 6c 43 6c 69 6b | 4c 6f 6f 70 20 7d 0d 09 |scalClik|Loop }..| |000048d0| 77 69 6e 64 6f 77 20 3a | 3d 20 46 72 6f 6e 74 57 |window :|= FrontW| |000048e0| 69 6e 64 6f 77 3b 0d 09 | 72 65 67 69 6f 6e 20 3a |indow;..|region :| |000048f0| 3d 20 4e 65 77 52 67 6e | 3b 0d 09 47 65 74 43 6c |= NewRgn|;..GetCl| |00004900| 69 70 28 20 72 65 67 69 | 6f 6e 20 29 3b 20 7b 20 |ip( regi|on ); { | |00004910| 73 61 76 65 20 74 68 65 | 20 6f 6c 64 20 63 6c 69 |save the| old cli| |00004920| 70 20 7d 0d 09 43 6c 69 | 70 52 65 63 74 28 20 77 |p }..Cli|pRect( w| |00004930| 69 6e 64 6f 77 5e 2e 70 | 6f 72 74 52 65 63 74 20 |indow^.p|ortRect | |00004940| 29 3b 20 7b 20 73 65 74 | 20 74 68 65 20 6e 65 77 |); { set| the new| |00004950| 20 63 6c 69 70 20 7d 0d | 09 41 64 6a 75 73 74 53 | clip }.|.AdjustS| |00004960| 63 72 6f 6c 6c 56 61 6c | 75 65 73 28 20 77 69 6e |crollVal|ues( win| |00004970| 64 6f 77 2c 20 54 52 55 | 45 20 29 3b 20 7b 20 70 |dow, TRU|E ); { p| |00004980| 61 73 73 20 54 52 55 45 | 20 66 6f 72 20 63 61 6e |ass TRUE| for can| |00004990| 52 65 64 72 61 77 20 7d | 0d 09 53 65 74 43 6c 69 |Redraw }|..SetCli| |000049a0| 70 28 20 72 65 67 69 6f | 6e 20 29 3b 20 7b 20 72 |p( regio|n ); { r| |000049b0| 65 73 74 6f 72 65 20 74 | 68 65 20 6f 6c 64 20 63 |estore t|he old c| |000049c0| 6c 69 70 20 7d 0d 09 44 | 69 73 70 6f 73 65 52 67 |lip }..D|isposeRg| |000049d0| 6e 28 20 72 65 67 69 6f | 6e 20 29 3b 0d 45 4e 44 |n( regio|n );.END| |000049e0| 3b 20 7b 20 50 61 73 63 | 61 6c 43 6c 69 6b 4c 6f |; { Pasc|alClikLo| |000049f0| 6f 70 20 7d 0d 7b 24 50 | 4f 50 7d 0d 0d 0d 0d 7b |op }.{$P|OP}....{| |00004a00| 24 53 20 4d 61 69 6e 7d | 0d 7b 24 50 55 53 48 7d |$S Main}|.{$PUSH}| |00004a10| 20 7b 24 5a 2b 7d 0d 46 | 55 4e 43 54 49 4f 4e 20 | {$Z+}.F|UNCTION | |00004a20| 47 65 74 4f 6c 64 43 6c | 69 6b 4c 6f 6f 70 20 3a |GetOldCl|ikLoop :| |00004a30| 20 50 72 6f 63 50 74 72 | 3b 0d 0d 7b 09 47 65 74 | ProcPtr|;..{.Get| |00004a40| 73 20 63 61 6c 6c 65 64 | 20 66 72 6f 6d 20 6f 75 |s called| from ou| |00004a50| 72 20 61 73 73 65 6d 62 | 6c 79 20 6c 61 6e 67 75 |r assemb|ly langu| |00004a60| 61 67 65 20 72 6f 75 74 | 69 6e 65 2c 20 41 73 6d |age rout|ine, Asm| |00004a70| 43 6c 69 6b 4c 6f 6f 70 | 2c 20 77 68 69 63 68 20 |ClikLoop|, which | |00004a80| 69 73 20 69 6e 0d 09 74 | 75 72 6e 20 63 61 6c 6c |is in..t|urn call| |00004a90| 65 64 20 62 79 20 74 68 | 65 20 54 45 43 6c 69 63 |ed by th|e TEClic| |00004aa0| 6b 20 74 6f 6f 6c 62 6f | 78 20 72 6f 75 74 69 6e |k toolbo|x routin| |00004ab0| 65 2e 20 49 74 20 72 65 | 74 75 72 6e 73 20 74 68 |e. It re|turns th| |00004ac0| 65 20 61 64 64 72 65 73 | 73 20 6f 66 20 74 68 65 |e addres|s of the| |00004ad0| 0d 09 64 65 66 61 75 6c | 74 20 63 6c 69 6b 4c 6f |..defaul|t clikLo| |00004ae0| 6f 70 20 72 6f 75 74 69 | 6e 65 20 74 68 61 74 20 |op routi|ne that | |00004af0| 77 61 73 20 70 75 74 20 | 69 6e 74 6f 20 74 68 65 |was put |into the| |00004b00| 20 54 45 52 65 63 20 62 | 79 20 54 45 41 75 74 6f | TERec b|y TEAuto| |00004b10| 56 69 65 77 20 74 6f 0d | 09 41 73 6d 43 6c 69 6b |View to.|.AsmClik| |00004b20| 4c 6f 6f 70 20 73 6f 20 | 74 68 61 74 20 69 74 20 |Loop so |that it | |00004b30| 63 61 6e 20 63 61 6c 6c | 20 69 74 2e 20 7d 0d 0d |can call| it. }..| |00004b40| 42 45 47 49 4e 20 7b 20 | 47 65 74 4f 6c 64 43 6c |BEGIN { |GetOldCl| |00004b50| 69 6b 4c 6f 6f 70 20 7d | 0d 09 47 65 74 4f 6c 64 |ikLoop }|..GetOld| |00004b60| 43 6c 69 6b 4c 6f 6f 70 | 20 3a 3d 20 44 6f 63 75 |ClikLoop| := Docu| |00004b70| 6d 65 6e 74 50 65 65 6b | 28 20 46 72 6f 6e 74 57 |mentPeek|( FrontW| |00004b80| 69 6e 64 6f 77 20 29 5e | 2e 64 6f 63 43 6c 69 6b |indow )^|.docClik| |00004b90| 3b 0d 45 4e 44 3b 20 7b | 20 47 65 74 4f 6c 64 43 |;.END; {| GetOldC| |00004ba0| 6c 69 6b 4c 6f 6f 70 20 | 7d 0d 7b 24 50 4f 50 7d |likLoop |}.{$POP}| |00004bb0| 0d 0d 0d 0d 50 52 4f 43 | 45 44 55 52 45 20 41 73 |....PROC|EDURE As| |00004bc0| 6d 43 6c 69 6b 4c 6f 6f | 70 3b 20 45 58 54 45 52 |mClikLoo|p; EXTER| |00004bd0| 4e 41 4c 3b 0d 0d 7b 09 | 41 20 72 65 66 65 72 65 |NAL;..{.|A refere| |00004be0| 6e 63 65 20 74 6f 20 6f | 75 72 20 61 73 73 65 6d |nce to o|ur assem| |00004bf0| 62 6c 79 20 6c 61 6e 67 | 75 61 67 65 20 72 6f 75 |bly lang|uage rou| |00004c00| 74 69 6e 65 20 74 68 61 | 74 20 67 65 74 73 20 61 |tine tha|t gets a| |00004c10| 74 74 61 63 68 65 64 20 | 74 6f 20 74 68 65 20 63 |ttached |to the c| |00004c20| 6c 69 6b 4c 6f 6f 70 0d | 09 66 69 65 6c 64 20 6f |likLoop.|.field o| |00004c30| 66 20 6f 75 72 20 54 45 | 20 72 65 63 6f 72 64 2e |f our TE| record.| |00004c40| 20 7d 0d 0d 0d 0d 7b 24 | 53 20 4d 61 69 6e 7d 0d | }....{$|S Main}.| |00004c50| 50 52 4f 43 45 44 55 52 | 45 20 44 6f 4e 65 77 3b |PROCEDUR|E DoNew;| |00004c60| 0d 0d 7b 09 43 72 65 61 | 74 65 20 61 20 6e 65 77 |..{.Crea|te a new| |00004c70| 20 64 6f 63 75 6d 65 6e | 74 20 61 6e 64 20 77 69 | documen|t and wi| |00004c80| 6e 64 6f 77 2e 20 7d 0d | 0d 7b 4d 69 6e 6f 72 20 |ndow. }.|.{Minor | |00004c90| 63 68 61 6e 67 65 73 20 | 66 72 6f 6d 20 54 45 53 |changes |from TES| |00004ca0| 61 6d 70 6c 65 2d 2d 54 | 45 53 74 79 6c 4e 65 77 |ample--T|EStylNew| |00004cb0| 20 69 6e 73 74 65 61 64 | 20 6f 66 20 54 45 4e 65 | instead| of TENe| |00004cc0| 77 2d 6d 61 6b 65 73 20 | 63 65 72 74 61 69 6e 20 |w-makes |certain | |00004cd0| 66 69 65 6c 64 73 20 69 | 6e 0d 74 68 65 20 65 64 |fields i|n.the ed| |00004ce0| 69 74 20 72 65 63 6f 72 | 64 20 28 6c 69 6e 65 48 |it recor|d (lineH| |00004cf0| 65 69 67 68 74 2c 20 74 | 78 46 6f 6e 74 2c 20 61 |eight, t|xFont, a| |00004d00| 6e 64 20 74 78 46 61 63 | 65 29 20 68 61 76 65 20 |nd txFac|e) have | |00004d10| 76 61 6c 75 65 20 6f 66 | 20 2d 31 20 61 6e 64 20 |value of| -1 and | |00004d20| 61 6c 6c 6f 63 74 65 73 | 20 6e 65 77 0d 74 61 62 |alloctes| new.tab| |00004d30| 6c 65 73 20 74 6f 20 68 | 6f 6c 64 20 73 74 79 6c |les to h|old styl| |00004d40| 65 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 7d 0d 0d |e inform|ation}..| |00004d50| 56 41 52 0d 09 67 6f 6f | 64 2c 20 69 67 6e 6f 72 |VAR..goo|d, ignor| |00004d60| 65 09 09 3a 20 42 4f 4f | 4c 45 41 4e 3b 0d 09 73 |e..: BOO|LEAN;..s| |00004d70| 74 6f 72 61 67 65 09 09 | 09 09 3a 20 50 74 72 3b |torage..|..: Ptr;| |00004d80| 0d 09 77 69 6e 64 6f 77 | 09 09 09 09 3a 20 57 69 |..window|....: Wi| |00004d90| 6e 64 6f 77 50 74 72 3b | 0d 09 64 65 73 74 52 65 |ndowPtr;|..destRe| |00004da0| 63 74 2c 20 76 69 65 77 | 52 65 63 74 09 3a 20 52 |ct, view|Rect.: R| |00004db0| 65 63 74 3b 0d 0d 0d 42 | 45 47 49 4e 20 7b 20 44 |ect;...B|EGIN { D| |00004dc0| 6f 4e 65 77 20 7d 0d 09 | 73 74 6f 72 61 67 65 20 |oNew }..|storage | |00004dd0| 3a 3d 20 4e 65 77 50 74 | 72 28 20 53 49 5a 45 4f |:= NewPt|r( SIZEO| |00004de0| 46 28 20 44 6f 63 75 6d | 65 6e 74 52 65 63 6f 72 |F( Docum|entRecor| |00004df0| 64 20 29 20 29 3b 0d 09 | 49 46 20 73 74 6f 72 61 |d ) );..|IF stora| |00004e00| 67 65 20 3c 3e 20 4e 49 | 4c 20 54 48 45 4e 20 42 |ge <> NI|L THEN B| |00004e10| 45 47 49 4e 0d 09 09 77 | 69 6e 64 6f 77 20 3a 3d |EGIN...w|indow :=| |00004e20| 20 47 65 74 4e 65 77 57 | 69 6e 64 6f 77 28 20 72 | GetNewW|indow( r| |00004e30| 44 6f 63 57 69 6e 64 6f | 77 2c 20 73 74 6f 72 61 |DocWindo|w, stora| |00004e40| 67 65 2c 20 57 69 6e 64 | 6f 77 50 74 72 28 20 2d |ge, Wind|owPtr( -| |00004e50| 31 20 29 20 29 3b 0d 09 | 09 49 46 20 77 69 6e 64 |1 ) );..|.IF wind| |00004e60| 6f 77 20 3c 3e 20 4e 49 | 4c 20 54 48 45 4e 20 42 |ow <> NI|L THEN B| |00004e70| 45 47 49 4e 0d 09 09 09 | 67 4e 75 6d 44 6f 63 75 |EGIN....|gNumDocu| |00004e80| 6d 65 6e 74 73 20 3a 3d | 20 67 4e 75 6d 44 6f 63 |ments :=| gNumDoc| |00004e90| 75 6d 65 6e 74 73 20 2b | 20 31 3b 0d 09 09 09 67 |uments +| 1;....g| |00004ea0| 6f 6f 64 20 3a 3d 20 46 | 41 4c 53 45 3b 0d 09 09 |ood := F|ALSE;...| |00004eb0| 09 53 65 74 50 6f 72 74 | 28 20 77 69 6e 64 6f 77 |.SetPort|( window| |00004ec0| 20 29 3b 0d 09 09 09 57 | 49 54 48 20 77 69 6e 64 | );....W|ITH wind| |00004ed0| 6f 77 5e 2c 20 44 6f 63 | 75 6d 65 6e 74 50 65 65 |ow^, Doc|umentPee| |00004ee0| 6b 28 20 77 69 6e 64 6f | 77 20 29 5e 20 44 4f 20 |k( windo|w )^ DO | |00004ef0| 42 45 47 49 4e 0d 09 09 | 09 09 47 65 74 54 45 52 |BEGIN...|..GetTER| |00004f00| 65 63 74 28 20 77 69 6e | 64 6f 77 2c 20 76 69 65 |ect( win|dow, vie| |00004f10| 77 52 65 63 74 20 29 3b | 0d 09 09 09 09 64 65 73 |wRect );|.....des| |00004f20| 74 52 65 63 74 20 3a 3d | 20 76 69 65 77 52 65 63 |tRect :=| viewRec| |00004f30| 74 3b 0d 09 09 09 09 64 | 65 73 74 52 65 63 74 2e |t;.....d|estRect.| |00004f40| 72 69 67 68 74 20 3a 3d | 20 64 65 73 74 52 65 63 |right :=| destRec| |00004f50| 74 2e 6c 65 66 74 20 2b | 20 6b 4d 61 78 44 6f 63 |t.left +| kMaxDoc| |00004f60| 57 69 64 74 68 3b 0d 09 | 09 09 09 64 6f 63 54 45 |Width;..|...docTE| |00004f70| 20 3a 3d 20 54 45 53 74 | 79 6c 4e 65 77 28 20 64 | := TESt|ylNew( d| |00004f80| 65 73 74 52 65 63 74 2c | 20 76 69 65 77 52 65 63 |estRect,| viewRec| |00004f90| 74 20 29 3b 0d 09 09 09 | 09 7b 20 55 73 65 20 54 |t );....|.{ Use T| |00004fa0| 45 53 74 79 6c 4e 65 77 | 20 69 6e 73 74 65 61 64 |EStylNew| instead| |00004fb0| 20 6f 66 20 54 45 4e 65 | 77 20 74 6f 20 69 6e 69 | of TENe|w to ini| |00004fc0| 74 69 61 6c 69 7a 65 20 | 54 45 52 65 63 20 63 6f |tialize |TERec co| |00004fd0| 72 72 65 63 74 6c 79 20 | 7d 0d 09 09 09 09 49 46 |rrectly |}.....IF| |00004fe0| 20 64 6f 63 54 45 20 3c | 3e 20 4e 49 4c 20 54 48 | docTE <|> NIL TH| |00004ff0| 45 4e 20 42 45 47 49 4e | 0d 09 09 09 09 09 67 6f |EN BEGIN|......go| |00005000| 6f 64 20 3a 3d 20 54 52 | 55 45 3b 09 09 09 09 7b |od := TR|UE;....{| |00005010| 69 66 20 54 45 4e 65 77 | 20 73 75 63 63 65 65 64 |if TENew| succeed| |00005020| 65 64 2c 20 77 65 20 68 | 61 76 65 20 61 20 67 6f |ed, we h|ave a go| |00005030| 6f 64 20 64 6f 63 75 6d | 65 6e 74 7d 0d 09 09 09 |od docum|ent}....| |00005040| 09 09 54 45 41 75 74 6f | 56 69 65 77 28 54 52 55 |..TEAuto|View(TRU| |00005050| 45 2c 20 64 6f 63 54 45 | 29 3b 0d 09 09 09 09 09 |E, docTE|);......| |00005060| 64 6f 63 43 6c 69 6b 20 | 3a 3d 20 64 6f 63 54 45 |docClik |:= docTE| |00005070| 5e 5e 2e 63 6c 69 6b 4c | 6f 6f 70 3b 0d 09 09 09 |^^.clikL|oop;....| |00005080| 09 09 64 6f 63 54 45 5e | 5e 2e 63 6c 69 6b 4c 6f |..docTE^|^.clikLo| |00005090| 6f 70 20 3a 3d 20 40 41 | 73 6d 43 6c 69 6b 4c 6f |op := @A|smClikLo| |000050a0| 6f 70 3b 0d 09 09 09 09 | 45 4e 44 3b 0d 09 09 09 |op;.....|END;....| |000050b0| 09 49 46 20 67 6f 6f 64 | 20 54 48 45 4e 20 42 45 |.IF good| THEN BE| |000050c0| 47 49 4e 0d 09 09 09 09 | 09 64 6f 63 56 53 63 72 |GIN.....|.docVScr| |000050d0| 6f 6c 6c 20 3a 3d 20 47 | 65 74 4e 65 77 43 6f 6e |oll := G|etNewCon| |000050e0| 74 72 6f 6c 28 20 72 56 | 53 63 72 6f 6c 6c 2c 20 |trol( rV|Scroll, | |000050f0| 77 69 6e 64 6f 77 20 29 | 3b 0d 09 09 09 09 09 67 |window )|;......g| |00005100| 6f 6f 64 20 3a 3d 20 28 | 20 64 6f 63 56 53 63 72 |ood := (| docVScr| |00005110| 6f 6c 6c 20 3c 3e 20 4e | 49 4c 20 29 3b 0d 09 09 |oll <> N|IL );...| |00005120| 09 09 45 4e 44 3b 20 7b | 20 69 66 20 7d 0d 09 09 |..END; {| if }...| |00005130| 09 09 49 46 20 67 6f 6f | 64 20 54 48 45 4e 20 42 |..IF goo|d THEN B| |00005140| 45 47 49 4e 0d 09 09 09 | 09 09 64 6f 63 48 53 63 |EGIN....|..docHSc| |00005150| 72 6f 6c 6c 20 3a 3d 20 | 47 65 74 4e 65 77 43 6f |roll := |GetNewCo| |00005160| 6e 74 72 6f 6c 28 20 72 | 48 53 63 72 6f 6c 6c 2c |ntrol( r|HScroll,| |00005170| 20 77 69 6e 64 6f 77 20 | 29 3b 0d 09 09 09 09 09 | window |);......| |00005180| 67 6f 6f 64 20 3a 3d 20 | 28 20 64 6f 63 48 53 63 |good := |( docHSc| |00005190| 72 6f 6c 6c 20 3c 3e 20 | 4e 49 4c 20 29 3b 0d 09 |roll <> |NIL );..| |000051a0| 09 09 09 45 4e 44 3b 20 | 7b 20 69 66 20 7d 0d 09 |...END; |{ if }..| |000051b0| 09 09 09 49 46 20 67 6f | 6f 64 20 54 48 45 4e 20 |...IF go|od THEN | |000051c0| 42 45 47 49 4e 0d 09 09 | 09 09 09 41 64 6a 75 73 |BEGIN...|...Adjus| |000051d0| 74 53 63 72 6f 6c 6c 56 | 61 6c 75 65 73 28 20 77 |tScrollV|alues( w| |000051e0| 69 6e 64 6f 77 2c 20 46 | 41 4c 53 45 20 29 3b 0d |indow, F|ALSE );.| |000051f0| 09 09 09 09 09 53 68 6f | 77 57 69 6e 64 6f 77 28 |.....Sho|wWindow(| |00005200| 20 77 69 6e 64 6f 77 20 | 29 3b 20 7b 20 69 66 20 | window |); { if | |00005210| 74 68 65 20 64 6f 63 75 | 6d 65 6e 74 20 69 73 20 |the docu|ment is | |00005220| 67 6f 6f 64 2c 20 6d 61 | 6b 65 20 74 68 65 20 77 |good, ma|ke the w| |00005230| 69 6e 64 6f 77 20 76 69 | 73 69 62 6c 65 20 7d 0d |indow vi|sible }.| |00005240| 09 09 09 09 45 4e 44 20 | 45 4c 53 45 20 42 45 47 |....END |ELSE BEG| |00005250| 49 4e 0d 09 09 09 09 09 | 69 67 6e 6f 72 65 20 3a |IN......|ignore :| |00005260| 3d 20 44 6f 43 6c 6f 73 | 65 57 69 6e 64 6f 77 28 |= DoClos|eWindow(| |00005270| 20 77 69 6e 64 6f 77 20 | 29 3b 20 7b 20 6f 74 68 | window |); { oth| |00005280| 65 72 77 69 73 65 20 72 | 65 67 72 65 74 20 77 65 |erwise r|egret we| |00005290| 20 65 76 65 72 20 63 72 | 65 61 74 65 64 20 69 74 | ever cr|eated it| |000052a0| 2e 2e 2e 20 7d 0d 09 09 | 09 09 09 41 6c 65 72 74 |... }...|...Alert| |000052b0| 55 73 65 72 28 20 65 4e | 6f 57 69 6e 64 6f 77 20 |User( eN|oWindow | |000052c0| 29 3b 20 7b 20 61 6e 64 | 20 74 65 6c 6c 20 75 73 |); { and| tell us| |000052d0| 65 72 20 7d 0d 09 09 09 | 09 45 4e 44 20 7b 20 69 |er }....|.END { i| |000052e0| 66 20 7d 0d 09 09 09 45 | 4e 44 3b 20 7b 20 77 69 |f }....E|ND; { wi| |000052f0| 74 68 20 7d 0d 09 09 45 | 4e 44 20 45 4c 53 45 0d |th }...E|ND ELSE.| |00005300| 09 09 09 44 69 73 70 6f | 73 50 74 72 28 20 73 74 |...Dispo|sPtr( st| |00005310| 6f 72 61 67 65 20 29 3b | 20 7b 20 67 65 74 20 72 |orage );| { get r| |00005320| 69 64 20 6f 66 20 74 68 | 65 20 73 74 6f 72 61 67 |id of th|e storag| |00005330| 65 20 69 66 20 69 74 20 | 69 73 20 6e 65 76 65 72 |e if it |is never| |00005340| 20 75 73 65 64 20 7d 0d | 09 45 4e 44 3b 20 7b 20 | used }.|.END; { | |00005350| 69 66 20 7d 0d 45 4e 44 | 3b 20 7b 20 44 6f 4e 65 |if }.END|; { DoNe| |00005360| 77 20 7d 0d 0d 0d 0d 7b | 24 53 20 4d 61 69 6e 7d |w }....{|$S Main}| |00005370| 0d 50 52 4f 43 45 44 55 | 52 45 20 42 69 67 42 61 |.PROCEDU|RE BigBa| |00005380| 64 45 72 72 6f 72 28 20 | 65 72 72 6f 72 20 3a 20 |dError( |error : | |00005390| 49 4e 54 45 47 45 52 20 | 29 3b 0d 42 45 47 49 4e |INTEGER |);.BEGIN| |000053a0| 0d 09 41 6c 65 72 74 55 | 73 65 72 28 20 65 72 72 |..AlertU|ser( err| |000053b0| 6f 72 20 29 3b 0d 09 45 | 78 69 74 54 6f 53 68 65 |or );..E|xitToShe| |000053c0| 6c 6c 3b 0d 45 4e 44 3b | 0d 0d 0d 0d 7b 24 53 20 |ll;.END;|....{$S | |000053d0| 49 6e 69 74 69 61 6c 69 | 7a 65 7d 0d 50 52 4f 43 |Initiali|ze}.PROC| |000053e0| 45 44 55 52 45 20 49 6e | 69 74 69 61 6c 69 7a 65 |EDURE In|itialize| |000053f0| 3b 0d 0d 7b 09 53 65 74 | 20 75 70 20 74 68 65 20 |;..{.Set| up the | |00005400| 77 68 6f 6c 65 20 77 6f | 72 6c 64 2c 20 69 6e 63 |whole wo|rld, inc| |00005410| 6c 75 64 69 6e 67 20 67 | 6c 6f 62 61 6c 20 76 61 |luding g|lobal va| |00005420| 72 69 61 62 6c 65 73 2c | 20 54 6f 6f 6c 62 6f 78 |riables,| Toolbox| |00005430| 20 6d 61 6e 61 67 65 72 | 73 2c 0d 20 09 6d 65 6e | manager|s,. .men| |00005440| 75 73 2c 20 61 6e 64 20 | 61 20 73 69 6e 67 6c 65 |us, and |a single| |00005450| 20 62 6c 61 6e 6b 20 64 | 6f 63 75 6d 65 6e 74 2e | blank d|ocument.| |00005460| 7d 0d 09 0d 7b 49 66 20 | 61 6e 20 65 72 72 6f 72 |}...{If |an error| |00005470| 20 69 73 20 64 65 74 65 | 63 74 65 64 2c 20 69 6e | is dete|cted, in| |00005480| 73 74 65 61 64 20 6f 66 | 20 6d 65 72 65 6c 79 20 |stead of| merely | |00005490| 64 6f 69 6e 67 20 61 6e | 20 45 78 69 74 54 6f 53 |doing an| ExitToS| |000054a0| 68 65 6c 6c 2c 0d 20 77 | 68 69 63 68 20 6c 65 61 |hell,. w|hich lea| |000054b0| 76 65 73 20 74 68 65 20 | 75 73 65 72 20 77 69 74 |ves the |user wit| |000054c0| 68 6f 75 74 20 6d 75 63 | 68 20 74 6f 20 67 6f 20 |hout muc|h to go | |000054d0| 6f 6e 2c 20 77 65 20 63 | 61 6c 6c 20 41 6c 65 72 |on, we c|all Aler| |000054e0| 74 55 73 65 72 2c 20 77 | 68 69 63 68 20 70 75 74 |tUser, w|hich put| |000054f0| 73 0d 20 75 70 20 61 20 | 73 69 6d 70 6c 65 20 61 |s. up a |simple a| |00005500| 6c 65 72 74 20 74 68 61 | 74 20 6a 75 73 74 20 73 |lert tha|t just s| |00005510| 61 79 73 20 61 6e 20 65 | 72 72 6f 72 20 6f 63 63 |ays an e|rror occ| |00005520| 75 72 72 65 64 20 61 6e | 64 20 74 68 65 6e 20 63 |urred an|d then c| |00005530| 61 6c 6c 73 20 45 78 69 | 74 54 6f 53 68 65 6c 6c |alls Exi|tToShell| |00005540| 2e 0d 20 53 69 6e 63 65 | 20 74 68 65 72 65 20 69 |.. Since| there i| |00005550| 73 20 6e 6f 20 6f 74 68 | 65 72 20 63 6c 65 61 6e |s no oth|er clean| |00005560| 75 70 20 6e 65 65 64 65 | 64 20 61 74 20 74 68 69 |up neede|d at thi| |00005570| 73 20 70 6f 69 6e 74 20 | 69 66 20 61 6e 20 65 72 |s point |if an er| |00005580| 72 6f 72 20 69 73 20 64 | 65 74 65 63 74 65 64 2c |ror is d|etected,| |00005590| 0d 20 74 68 69 73 20 66 | 6f 72 6d 20 6f 66 20 65 |. this f|orm of e| |000055a0| 72 72 6f 72 2d 20 68 61 | 6e 64 6c 69 6e 67 20 69 |rror- ha|ndling i| |000055b0| 73 20 61 63 63 65 70 74 | 61 62 6c 65 2e 20 49 66 |s accept|able. If| |000055c0| 20 6d 6f 72 65 20 73 6f | 70 68 69 73 74 69 63 61 | more so|phistica| |000055d0| 74 65 64 20 65 72 72 6f | 72 20 72 65 63 6f 76 65 |ted erro|r recove| |000055e0| 72 79 0d 20 69 73 20 6e | 65 65 64 65 64 2c 20 61 |ry. is n|eeded, a| |000055f0| 6e 20 65 78 63 65 70 74 | 69 6f 6e 20 6d 65 63 68 |n except|ion mech| |00005600| 61 6e 69 73 6d 2c 20 73 | 75 63 68 20 61 73 20 69 |anism, s|uch as i| |00005610| 73 20 70 72 6f 76 69 64 | 65 64 20 62 79 20 53 69 |s provid|ed by Si| |00005620| 67 6e 61 6c 73 2c 20 63 | 61 6e 20 62 65 20 75 73 |gnals, c|an be us| |00005630| 65 64 2e 7d 0d 0d 0d 56 | 41 52 0d 09 6d 65 6e 75 |ed.}...V|AR..menu| |00005640| 42 61 72 09 09 09 09 3a | 20 48 61 6e 64 6c 65 3b |Bar....:| Handle;| |00005650| 0d 09 74 6f 74 61 6c 2c | 20 63 6f 6e 74 69 67 09 |..total,| contig.| |00005660| 09 3a 20 4c 6f 6e 67 49 | 6e 74 3b 0d 09 69 67 6e |.: LongI|nt;..ign| |00005670| 6f 72 65 52 65 73 75 6c | 74 09 09 3a 20 42 4f 4f |oreResul|t..: BOO| |00005680| 4c 45 41 4e 3b 0d 09 65 | 76 65 6e 74 09 09 09 09 |LEAN;..e|vent....| |00005690| 3a 20 45 76 65 6e 74 52 | 65 63 6f 72 64 3b 0d 09 |: EventR|ecord;..| |000056a0| 63 6f 75 6e 74 2c 20 69 | 67 6e 6f 72 65 45 72 72 |count, i|gnoreErr| |000056b0| 6f 72 09 3a 20 49 4e 54 | 45 47 45 52 3b 0d 09 0d |or.: INT|EGER;...| |000056c0| 09 50 52 4f 43 45 44 55 | 52 45 20 42 69 67 42 61 |.PROCEDU|RE BigBa| |000056d0| 64 45 72 72 6f 72 28 20 | 65 72 72 6f 72 20 3a 20 |dError( |error : | |000056e0| 49 4e 54 45 47 45 52 20 | 29 3b 0d 09 42 45 47 49 |INTEGER |);..BEGI| |000056f0| 4e 0d 09 09 41 6c 65 72 | 74 55 73 65 72 28 20 65 |N...Aler|tUser( e| |00005700| 72 72 6f 72 20 29 3b 0d | 09 09 45 78 69 74 54 6f |rror );.|..ExitTo| |00005710| 53 68 65 6c 6c 3b 0d 09 | 45 4e 44 3b 0d 0d 42 45 |Shell;..|END;..BE| |00005720| 47 49 4e 20 7b 20 49 6e | 69 74 69 61 6c 69 7a 65 |GIN { In|itialize| |00005730| 20 7d 0d 09 67 49 6e 42 | 61 63 6b 67 72 6f 75 6e | }..gInB|ackgroun| |00005740| 64 20 3a 3d 20 46 41 4c | 53 45 3b 0d 0d 09 49 6e |d := FAL|SE;...In| |00005750| 69 74 47 72 61 66 28 40 | 74 68 65 50 6f 72 74 29 |itGraf(@|thePort)| |00005760| 3b 0d 09 49 6e 69 74 46 | 6f 6e 74 73 3b 0d 09 49 |;..InitF|onts;..I| |00005770| 6e 69 74 57 69 6e 64 6f | 77 73 3b 0d 09 49 6e 69 |nitWindo|ws;..Ini| |00005780| 74 4d 65 6e 75 73 3b 0d | 09 54 45 49 6e 69 74 3b |tMenus;.|.TEInit;| |00005790| 0d 09 49 6e 69 74 44 69 | 61 6c 6f 67 73 28 4e 49 |..InitDi|alogs(NI| |000057a0| 4c 29 3b 0d 09 49 6e 69 | 74 43 75 72 73 6f 72 3b |L);..Ini|tCursor;| |000057b0| 0d 0d 09 46 4f 52 20 63 | 6f 75 6e 74 20 3a 3d 20 |...FOR c|ount := | |000057c0| 31 20 54 4f 20 33 20 44 | 4f 0d 09 09 69 67 6e 6f |1 TO 3 D|O...igno| |000057d0| 72 65 52 65 73 75 6c 74 | 20 3a 3d 20 45 76 65 6e |reResult| := Even| |000057e0| 74 41 76 61 69 6c 28 65 | 76 65 72 79 45 76 65 6e |tAvail(e|veryEven| |000057f0| 74 2c 20 65 76 65 6e 74 | 29 3b 0d 09 69 67 6e 6f |t, event|);..igno| |00005800| 72 65 45 72 72 6f 72 20 | 3a 3d 20 53 79 73 45 6e |reError |:= SysEn| |00005810| 76 69 72 6f 6e 73 28 6b | 53 79 73 45 6e 76 69 72 |virons(k|SysEnvir| |00005820| 6f 6e 73 56 65 72 73 69 | 6f 6e 2c 20 67 4d 61 63 |onsVersi|on, gMac| |00005830| 29 3b 0d 09 49 46 20 67 | 4d 61 63 2e 6d 61 63 68 |);..IF g|Mac.mach| |00005840| 69 6e 65 54 79 70 65 20 | 3c 20 30 20 54 48 45 4e |ineType |< 0 THEN| |00005850| 20 42 69 67 42 61 64 45 | 72 72 6f 72 28 65 57 72 | BigBadE|rror(eWr| |00005860| 6f 6e 67 4d 61 63 68 69 | 6e 65 29 3b 0d 09 67 48 |ongMachi|ne);..gH| |00005870| 61 73 57 61 69 74 4e 65 | 78 74 45 76 65 6e 74 20 |asWaitNe|xtEvent | |00005880| 3a 3d 20 54 72 61 70 41 | 76 61 69 6c 61 62 6c 65 |:= TrapA|vailable| |00005890| 28 5f 57 61 69 74 4e 65 | 78 74 45 76 65 6e 74 2c |(_WaitNe|xtEvent,| |000058a0| 20 54 6f 6f 6c 54 72 61 | 70 29 3b 0d 0d 09 0d 09 | ToolTra|p);.....| |000058b0| 49 46 20 4f 52 44 28 20 | 47 65 74 41 70 70 6c 4c |IF ORD( |GetApplL| |000058c0| 69 6d 69 74 20 29 20 2d | 20 4f 52 44 28 20 41 70 |imit ) -| ORD( Ap| |000058d0| 70 6c 69 63 5a 6f 6e 65 | 20 29 20 3c 20 6b 4d 69 |plicZone| ) < kMi| |000058e0| 6e 48 65 61 70 20 54 48 | 45 4e 0d 09 09 42 69 67 |nHeap TH|EN...Big| |000058f0| 42 61 64 45 72 72 6f 72 | 28 20 65 53 6d 61 6c 6c |BadError|( eSmall| |00005900| 53 69 7a 65 20 29 3b 0d | 09 50 75 72 67 65 53 70 |Size );.|.PurgeSp| |00005910| 61 63 65 28 20 74 6f 74 | 61 6c 2c 20 63 6f 6e 74 |ace( tot|al, cont| |00005920| 69 67 20 29 3b 0d 09 49 | 46 20 74 6f 74 61 6c 20 |ig );..I|F total | |00005930| 3c 20 6b 4d 69 6e 53 70 | 61 63 65 20 54 48 45 4e |< kMinSp|ace THEN| |00005940| 0d 09 09 49 46 20 55 6e | 6c 6f 61 64 53 63 72 61 |...IF Un|loadScra| |00005950| 70 20 3c 3e 20 6e 6f 45 | 72 72 20 54 48 45 4e 0d |p <> noE|rr THEN.| |00005960| 09 09 09 42 69 67 42 61 | 64 45 72 72 6f 72 28 20 |...BigBa|dError( | |00005970| 65 4e 6f 4d 65 6d 6f 72 | 79 20 29 0d 09 09 45 4c |eNoMemor|y )...EL| |00005980| 53 45 20 42 45 47 49 4e | 0d 09 09 09 50 75 72 67 |SE BEGIN|....Purg| |00005990| 65 53 70 61 63 65 28 20 | 74 6f 74 61 6c 2c 20 63 |eSpace( |total, c| |000059a0| 6f 6e 74 69 67 20 29 3b | 0d 09 09 09 49 46 20 74 |ontig );|....IF t| |000059b0| 6f 74 61 6c 20 3c 20 6b | 4d 69 6e 53 70 61 63 65 |otal < k|MinSpace| |000059c0| 20 54 48 45 4e 0d 09 09 | 09 09 42 69 67 42 61 64 | THEN...|..BigBad| |000059d0| 45 72 72 6f 72 28 20 65 | 4e 6f 4d 65 6d 6f 72 79 |Error( e|NoMemory| |000059e0| 20 29 3b 0d 09 09 45 4e | 44 3b 20 7b 20 69 66 20 | );...EN|D; { if | |000059f0| 7d 0d 0d 09 6d 65 6e 75 | 42 61 72 20 3a 3d 20 47 |}...menu|Bar := G| |00005a00| 65 74 4e 65 77 4d 42 61 | 72 28 20 72 4d 65 6e 75 |etNewMBa|r( rMenu| |00005a10| 42 61 72 20 29 3b 20 7b | 20 72 65 61 64 20 6d 65 |Bar ); {| read me| |00005a20| 6e 75 73 20 69 6e 74 6f | 20 6d 65 6e 75 20 62 61 |nus into| menu ba| |00005a30| 72 20 7d 0d 09 49 46 20 | 6d 65 6e 75 42 61 72 20 |r }..IF |menuBar | |00005a40| 3d 20 4e 49 4c 20 54 48 | 45 4e 0d 09 09 42 69 67 |= NIL TH|EN...Big| |00005a50| 42 61 64 45 72 72 6f 72 | 28 20 65 4e 6f 4d 65 6d |BadError|( eNoMem| |00005a60| 6f 72 79 20 29 3b 0d 09 | 53 65 74 4d 65 6e 75 42 |ory );..|SetMenuB| |00005a70| 61 72 28 20 6d 65 6e 75 | 42 61 72 20 29 3b 20 7b |ar( menu|Bar ); {| |00005a80| 20 69 6e 73 74 61 6c 6c | 20 6d 65 6e 75 73 20 7d | install| menus }| |00005a90| 0d 09 44 69 73 70 6f 73 | 48 61 6e 64 6c 65 28 20 |..Dispos|Handle( | |00005aa0| 6d 65 6e 75 42 61 72 20 | 29 3b 0d 09 41 64 64 52 |menuBar |);..AddR| |00005ab0| 65 73 4d 65 6e 75 28 20 | 47 65 74 4d 48 61 6e 64 |esMenu( |GetMHand| |00005ac0| 6c 65 28 20 6d 41 70 70 | 6c 65 20 29 2c 20 27 44 |le( mApp|le ), 'D| |00005ad0| 52 56 52 27 20 29 3b 09 | 7b 20 61 64 64 20 44 41 |RVR' );.|{ add DA| |00005ae0| 20 6e 61 6d 65 73 20 74 | 6f 20 41 70 70 6c 65 20 | names t|o Apple | |00005af0| 6d 65 6e 75 20 7d 0d 09 | 41 64 64 52 65 73 4d 65 |menu }..|AddResMe| |00005b00| 6e 75 28 20 47 65 74 4d | 48 61 6e 64 6c 65 28 20 |nu( GetM|Handle( | |00005b10| 6d 46 6f 6e 74 20 29 2c | 27 46 4f 4e 54 27 20 29 |mFont ),|'FONT' )| |00005b20| 3b 20 7b 20 61 64 64 20 | 46 6f 6e 74 20 6e 61 6d |; { add |Font nam| |00005b30| 65 73 20 74 6f 20 46 6f | 6e 74 20 4d 65 6e 75 20 |es to Fo|nt Menu | |00005b40| 7d 0d 09 44 72 61 77 4d | 65 6e 75 42 61 72 3b 0d |}..DrawM|enuBar;.| |00005b50| 09 67 4e 75 6d 44 6f 63 | 75 6d 65 6e 74 73 20 3a |.gNumDoc|uments :| |00005b60| 3d 20 30 3b 0d 0d 09 7b | 20 64 6f 20 6f 74 68 65 |= 0;...{| do othe| |00005b70| 72 20 69 6e 69 74 69 61 | 6c 69 7a 61 74 69 6f 6e |r initia|lization| |00005b80| 20 68 65 72 65 20 7d 0d | 09 7b 20 73 65 74 20 75 | here }.|.{ set u| |00005b90| 70 20 70 72 69 6e 74 65 | 72 20 73 74 75 66 66 2d |p printe|r stuff-| |00005ba0| 74 68 69 73 20 77 69 6c | 6c 20 61 6c 6c 6f 77 20 |this wil|l allow | |00005bb0| 74 68 65 20 64 65 66 61 | 75 6c 74 20 70 61 67 65 |the defa|ult page| |00005bc0| 53 65 74 75 70 20 70 61 | 72 61 6d 65 74 65 72 73 |Setup pa|rameters| |00005bd0| 20 74 6f 20 62 65 20 75 | 73 65 64 2c 20 73 6f 20 | to be u|sed, so | |00005be0| 69 66 0d 09 20 20 74 68 | 65 20 75 73 65 64 20 64 |if.. th|e used d| |00005bf0| 65 63 69 64 65 73 20 74 | 6f 20 70 72 69 6e 74 20 |ecides t|o print | |00005c00| 77 69 74 68 20 6f 75 74 | 20 75 73 69 6e 67 20 70 |with out| using p| |00005c10| 61 67 65 53 65 74 75 70 | 20 65 76 65 72 79 74 68 |ageSetup| everyth| |00005c20| 69 6e 67 20 77 69 6c 6c | 20 62 65 20 6f 6b 61 79 |ing will| be okay| |00005c30| 20 7d 0d 09 20 20 0d 09 | 67 50 72 69 6e 74 65 72 | }.. ..|gPrinter| |00005c40| 52 65 63 6f 72 64 20 3a | 3d 20 54 48 50 72 69 6e |Record :|= THPrin| |00005c50| 74 28 20 4e 65 77 48 61 | 6e 64 6c 65 28 20 53 69 |t( NewHa|ndle( Si| |00005c60| 7a 65 4f 46 28 20 54 50 | 72 69 6e 74 20 29 20 29 |zeOF( TP|rint ) )| |00005c70| 20 29 3b 20 7b 61 6c 6c | 6f 63 61 74 65 20 61 20 | ); {all|ocate a | |00005c80| 70 72 69 6e 74 20 72 65 | 63 6f 72 64 7d 0d 09 49 |print re|cord}..I| |00005c90| 46 20 67 50 72 69 6e 74 | 65 72 52 65 63 6f 72 64 |F gPrint|erRecord| |00005ca0| 20 3c 3e 20 4e 49 4c 20 | 54 48 45 4e 20 42 45 47 | <> NIL |THEN BEG| |00005cb0| 49 4e 20 7b 69 66 20 77 | 65 27 72 65 20 73 75 63 |IN {if w|e're suc| |00005cc0| 63 65 73 73 66 75 6c 20 | 74 68 65 6e 20 73 65 74 |cessful |then set| |00005cd0| 75 70 20 74 68 65 20 64 | 65 66 61 75 6c 74 20 73 |up the d|efault s| |00005ce0| 65 74 74 69 6e 67 73 7d | 0d 09 09 50 72 4f 70 65 |ettings}|...PrOpe| |00005cf0| 6e 3b 20 7b 6f 70 65 6e | 20 74 68 65 20 72 65 63 |n; {open| the rec| |00005d00| 6f 72 64 20 7d 0d 09 09 | 50 72 69 6e 74 44 65 66 |ord }...|PrintDef| |00005d10| 61 75 6c 74 28 20 67 50 | 72 69 6e 74 65 72 52 65 |ault( gP|rinterRe| |00005d20| 63 6f 72 64 20 29 3b 20 | 7b 20 6c 6f 61 64 20 69 |cord ); |{ load i| |00005d30| 6e 20 64 65 66 61 75 6c | 74 20 73 65 74 74 69 6e |n defaul|t settin| |00005d40| 67 73 20 7d 0d 09 09 50 | 72 43 6c 6f 73 65 3b 20 |gs }...P|rClose; | |00005d50| 7b 20 63 6c 6f 73 65 20 | 69 74 20 75 70 20 7d 0d |{ close |it up }.| |00005d60| 09 45 4e 44 3b 20 7b 20 | 69 66 20 7d 0d 0d 09 44 |.END; { |if }...D| |00005d70| 6f 4e 65 77 3b 20 7b 20 | 63 72 65 61 74 65 20 61 |oNew; { |create a| |00005d80| 20 73 69 6e 67 6c 65 20 | 65 6d 70 74 79 20 64 6f | single |empty do| |00005d90| 63 75 6d 65 6e 74 20 7d | 0d 45 4e 44 3b 20 7b 49 |cument }|.END; {I| |00005da0| 6e 69 74 69 61 6c 69 7a | 65 7d 0d 0d 0d 0d 7b 24 |nitializ|e}....{$| |00005db0| 53 20 4d 61 69 6e 7d 09 | 0d 50 52 4f 43 45 44 55 |S Main}.|.PROCEDU| |00005dc0| 52 45 20 50 72 69 6e 74 | 54 65 78 74 28 20 68 54 |RE Print|Text( hT| |00005dd0| 45 20 3a 20 54 45 48 61 | 6e 64 6c 65 20 29 3b 0d |E : TEHa|ndle );.| |00005de0| 0d 7b 09 50 72 69 6e 74 | 73 20 74 68 65 20 65 64 |.{.Print|s the ed| |00005df0| 69 74 20 72 65 63 6f 72 | 64 2e 20 4f 70 65 6e 73 |it recor|d. Opens| |00005e00| 20 61 20 70 72 69 6e 74 | 65 72 20 70 6f 72 74 2c | a print|er port,| |00005e10| 20 63 61 6c 63 75 6c 61 | 74 65 73 20 74 68 65 20 | calcula|tes the | |00005e20| 6e 75 6d 62 65 72 73 20 | 6f 66 20 6c 69 6e 65 73 |numbers |of lines| |00005e30| 0d 20 20 20 20 70 65 72 | 20 70 61 67 65 20 28 69 |. per| page (i| |00005e40| 74 20 6d 61 79 20 62 65 | 20 64 69 66 66 65 72 65 |t may be| differe| |00005e50| 6e 74 20 66 6f 72 20 65 | 61 63 68 20 70 61 67 65 |nt for e|ach page| |00005e60| 20 64 65 70 65 6e 64 69 | 6e 67 20 6f 6e 20 74 68 | dependi|ng on th| |00005e70| 65 20 74 68 65 20 74 65 | 78 74 20 73 74 79 6c 65 |e the te|xt style| |00005e80| 73 29 20 61 6e 64 0d 09 | 74 68 65 6e 20 63 61 6c |s) and..|then cal| |00005e90| 6c 73 20 54 45 55 70 64 | 61 74 65 20 66 6f 72 20 |ls TEUpd|ate for | |00005ea0| 74 68 65 20 70 61 67 65 | 2c 20 73 63 72 6f 6c 6c |the page|, scroll| |00005eb0| 20 61 20 70 61 67 65 20 | 61 6e 64 20 54 45 55 70 | a page |and TEUp| |00005ec0| 64 61 74 65 2c 20 65 74 | 63 2e 20 7d 0d 0d 43 4f |date, et|c. }..CO| |00005ed0| 4e 53 54 0d 09 4d 61 72 | 67 69 6e 73 09 09 09 09 |NST..Mar|gins....| |00005ee0| 3d 20 32 30 3b 20 09 09 | 7b 20 70 61 67 65 20 6d |= 20; ..|{ page m| |00005ef0| 61 72 67 69 6e 73 20 7d | 0d 09 0d 56 41 52 0d 09 |argins }|...VAR..| |00005f00| 74 6f 74 61 6c 4c 69 6e | 65 73 09 09 09 3a 20 49 |totalLin|es...: I| |00005f10| 4e 54 45 47 45 52 3b 09 | 7b 20 6e 75 6d 62 65 72 |NTEGER;.|{ number| |00005f20| 20 6f 66 20 6c 69 6e 65 | 73 20 69 6e 20 74 65 78 | of line|s in tex| |00005f30| 74 20 7d 0d 09 72 56 69 | 65 77 09 09 09 09 3a 20 |t }..rVi|ew....: | |00005f40| 52 65 63 74 3b 09 09 7b | 20 76 69 65 77 52 65 63 |Rect;..{| viewRec| |00005f50| 74 20 66 6f 72 20 54 45 | 52 65 63 74 20 7d 0d 09 |t for TE|Rect }..| |00005f60| 6f 6c 64 50 6f 72 74 09 | 09 09 09 3a 20 67 72 61 |oldPort.|...: gra| |00005f70| 66 50 74 72 3b 09 7b 20 | 68 6f 6c 64 20 6f 72 69 |fPtr;.{ |hold ori| |00005f80| 67 69 6e 61 6c 20 67 72 | 61 66 50 74 72 20 7d 0d |ginal gr|afPtr }.| |00005f90| 09 6f 6c 64 56 69 65 77 | 09 09 09 09 3a 20 52 65 |.oldView|....: Re| |00005fa0| 63 74 3b 09 09 7b 20 68 | 6f 6c 64 20 6f 72 69 67 |ct;..{ h|old orig| |00005fb0| 69 6e 61 6c 20 76 69 65 | 77 52 65 63 74 20 7d 0d |inal vie|wRect }.| |00005fc0| 09 6f 6c 64 44 65 73 74 | 09 09 09 09 3a 20 52 65 |.oldDest|....: Re| |00005fd0| 63 74 3b 09 09 7b 20 68 | 6f 6c 64 20 6f 72 69 67 |ct;..{ h|old orig| |00005fe0| 69 6e 61 6c 20 64 65 73 | 74 52 65 63 74 20 7d 0d |inal des|tRect }.| |00005ff0| 09 74 6f 74 61 6c 48 65 | 69 67 68 74 09 09 09 3a |.totalHe|ight...:| |00006000| 20 49 4e 54 45 47 45 52 | 3b 09 7b 20 6c 69 6e 65 | INTEGER|;.{ line| |00006010| 48 65 69 67 68 74 20 66 | 6f 72 20 54 45 52 65 63 |Height f|or TERec| |00006020| 20 7d 0d 09 63 75 72 72 | 65 6e 74 4c 69 6e 65 09 | }..curr|entLine.| |00006030| 09 09 3a 20 49 4e 54 45 | 47 45 52 3b 09 7b 20 77 |..: INTE|GER;.{ w| |00006040| 68 61 74 20 6c 69 6e 65 | 20 61 72 65 20 77 65 20 |hat line| are we | |00006050| 6f 6e 20 7d 0d 09 73 63 | 72 6f 6c 6c 41 6d 6f 75 |on }..sc|rollAmou| |00006060| 6e 74 09 09 3a 20 49 4e | 54 45 47 45 52 3b 09 7b |nt..: IN|TEGER;.{| |00006070| 20 68 6f 77 20 6d 75 63 | 68 20 77 65 20 73 63 72 | how muc|h we scr| |00006080| 6f 6c 6c 20 62 79 20 7d | 0d 09 7a 65 72 6f 52 65 |oll by }|..zeroRe| |00006090| 63 74 09 09 09 3a 20 52 | 65 63 74 3b 09 09 7b 20 |ct...: R|ect;..{ | |000060a0| 30 2c 30 2c 30 2c 30 20 | 72 65 63 74 20 75 73 65 |0,0,0,0 |rect use| |000060b0| 64 20 69 6e 20 63 6c 69 | 70 52 65 63 74 20 7d 0d |d in cli|pRect }.| |000060c0| 09 0d 09 74 68 65 50 72 | 69 6e 74 65 72 53 74 61 |...thePr|interSta| |000060d0| 74 75 73 20 09 3a 20 54 | 50 72 53 74 61 74 75 73 |tus .: T|PrStatus| |000060e0| 3b 20 7b 20 70 72 69 6e | 74 65 72 20 73 74 61 74 |; { prin|ter stat| |000060f0| 75 73 20 7d 0d 09 6f 70 | 65 6e 50 72 69 6e 74 4d |us }..op|enPrintM| |00006100| 61 6e 61 67 65 72 09 3a | 20 42 4f 4f 4c 45 41 4e |anager.:| BOOLEAN| |00006110| 3b 09 7b 20 66 6c 61 67 | 20 69 66 20 70 72 69 6e |;.{ flag| if prin| |00006120| 74 20 6d 61 6e 61 67 65 | 72 20 63 61 6e 20 62 65 |t manage|r can be| |00006130| 20 6f 70 65 6e 65 64 20 | 6f 6b 61 79 20 7d 0d 09 | opened |okay }..| |00006140| 61 62 6f 72 74 09 09 09 | 09 3a 20 42 4f 4f 4c 45 |abort...|.: BOOLE| |00006150| 41 4e 3b 09 7b 20 66 6c | 61 67 20 69 66 20 63 6d |AN;.{ fl|ag if cm| |00006160| 64 2d 70 65 72 69 6f 64 | 20 69 73 20 68 69 74 20 |d-period| is hit | |00006170| 74 6f 20 65 78 69 74 20 | 72 6f 75 74 69 6e 65 20 |to exit |routine | |00006180| 7d 0d 09 76 69 65 77 48 | 65 69 67 68 74 20 09 09 |}..viewH|eight ..| |00006190| 09 3a 20 49 4e 54 45 47 | 45 52 3b 09 7b 20 74 65 |.: INTEG|ER;.{ te| |000061a0| 6d 70 20 74 68 61 74 20 | 68 61 73 20 74 68 65 20 |mp that |has the | |000061b0| 76 69 65 77 52 65 63 74 | 20 68 65 69 67 68 74 2b |viewRect| height+| |000061c0| 31 20 74 6f 20 74 65 73 | 74 20 63 6f 6e 64 69 74 |1 to tes|t condit| |000061d0| 69 6f 6e 73 20 7d 0d 0d | 09 0d 42 45 47 49 4e 20 |ions }..|..BEGIN | |000061e0| 7b 20 50 72 69 6e 74 54 | 65 78 74 20 7d 0d 09 4f |{ PrintT|ext }..O| |000061f0| 70 65 6e 50 72 69 6e 74 | 4d 61 6e 61 67 65 72 20 |penPrint|Manager | |00006200| 3a 3d 20 46 41 4c 53 45 | 3b 20 7b 70 72 69 6e 74 |:= FALSE|; {print| |00006210| 65 72 20 6e 6f 74 20 6f | 70 65 6e 20 79 65 74 7d |er not o|pen yet}| |00006220| 0d 09 49 46 20 67 50 72 | 69 6e 74 65 72 52 65 63 |..IF gPr|interRec| |00006230| 6f 72 64 20 3c 3e 20 4e | 49 4c 20 54 48 45 4e 20 |ord <> N|IL THEN | |00006240| 42 45 47 49 4e 20 7b 20 | 64 6f 20 77 65 20 68 61 |BEGIN { |do we ha| |00006250| 76 65 20 61 20 6c 65 67 | 69 74 69 6d 61 74 65 20 |ve a leg|itimate | |00006260| 72 65 63 6f 72 64 3f 7d | 0d 09 09 50 72 4f 70 65 |record?}|...PrOpe| |00006270| 6e 3b 20 7b 6f 70 65 6e | 20 6d 72 2e 20 70 72 69 |n; {open| mr. pri| |00006280| 6e 74 20 72 65 63 6f 72 | 64 20 69 66 20 6f 6b 61 |nt recor|d if oka| |00006290| 79 7d 0d 09 09 49 46 20 | 50 72 4a 6f 62 44 69 61 |y}...IF |PrJobDia| |000062a0| 6c 6f 67 28 20 67 50 72 | 69 6e 74 65 72 52 65 63 |log( gPr|interRec| |000062b0| 6f 72 64 20 29 20 54 48 | 45 4e 20 42 45 47 49 4e |ord ) TH|EN BEGIN| |000062c0| 20 7b 62 72 69 6e 67 20 | 75 70 20 6a 6f 62 20 64 | {bring |up job d| |000062d0| 69 61 6c 6f 67 7d 0d 09 | 09 09 47 65 74 50 6f 72 |ialog}..|..GetPor| |000062e0| 74 28 20 6f 6c 64 50 6f | 72 74 20 29 3b 20 7b 20 |t( oldPo|rt ); { | |000062f0| 73 61 76 65 20 74 68 65 | 20 6f 6c 64 20 73 74 75 |save the| old stu| |00006300| 66 66 20 74 6f 20 72 65 | 73 74 6f 72 65 20 6c 61 |ff to re|store la| |00006310| 74 65 72 20 7d 0d 09 09 | 09 6f 6c 64 56 69 65 77 |ter }...|.oldView| |00006320| 20 3a 3d 20 68 54 45 5e | 5e 2e 76 69 65 77 52 65 | := hTE^|^.viewRe| |00006330| 63 74 3b 20 0d 09 09 09 | 6f 6c 64 44 65 73 74 20 |ct; ....|oldDest | |00006340| 3a 3d 20 68 54 45 5e 5e | 2e 64 65 73 74 52 65 63 |:= hTE^^|.destRec| |00006350| 74 3b 0d 09 09 09 67 50 | 72 69 6e 74 65 72 50 6f |t;....gP|rinterPo| |00006360| 72 74 20 3a 3d 20 50 72 | 4f 70 65 6e 44 6f 63 28 |rt := Pr|OpenDoc(| |00006370| 20 67 50 72 69 6e 74 65 | 72 52 65 63 6f 72 64 2c | gPrinte|rRecord,| |00006380| 20 4e 49 4c 2c 20 4e 49 | 4c 20 29 3b 0d 09 09 09 | NIL, NI|L );....| |00006390| 4f 70 65 6e 50 72 69 6e | 74 4d 61 6e 61 67 65 72 |OpenPrin|tManager| |000063a0| 20 3a 3d 20 28 20 50 72 | 45 72 72 6f 72 20 3d 20 | := ( Pr|Error = | |000063b0| 6e 6f 45 72 72 20 29 3b | 0d 09 09 45 4e 44 3b 20 |noErr );|...END; | |000063c0| 7b 20 69 66 20 7d 0d 09 | 45 4e 44 3b 20 7b 20 69 |{ if }..|END; { i| |000063d0| 66 20 7d 0d 0d 09 49 46 | 20 4f 70 65 6e 50 72 69 |f }...IF| OpenPri| |000063e0| 6e 74 4d 61 6e 61 67 65 | 72 20 54 48 45 4e 20 42 |ntManage|r THEN B| |000063f0| 45 47 49 4e 0d 09 09 53 | 65 74 50 6f 72 74 28 20 |EGIN...S|etPort( | +--------+-------------------------+-------------------------+--------+--------+ Only 25.0 KB of data is shown above.